/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * articulos_sie_rep_masvenxp.java
 *
 * Created on 22/03/2011, 10:30:14 AM
 */

package sie_invdis;

import java.awt.print.PrinterException;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;

import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.JTable.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Date;
import java.util.Calendar;
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.text.*;
import javax.swing.JFrame;
import javax.swing.table.DefaultTableCellRenderer;

import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.ui.RefineryUtilities;

/**
 *
 * @author Michelle
 */
public class articulos_sie_rep_masvenxp extends javax.swing.JFrame {

     private javax.swing.table.DefaultTableModel jtable_modelo;
     private javax.swing.table.DefaultTableModel jtable_modelo_apa;
     private javax.swing.table.DefaultTableModel jtable_modelo_compra;
     private javax.swing.table.DefaultTableModel jtable_modelo_detxtie;
     private javax.swing.table.DefaultTableModel jtable_modelo_resumencostos;
     private javax.swing.table.DefaultTableModel jtable_modelo_compraxfam;
     private javax.swing.table.DefaultTableModel jtable_modelo_compraxfammes;



      //private javax.swing.table.DefaultTableModel jtable_tiendas;
    private  JTable jtable_tiendas=variables_global.gettabla_tiendas();
      DefaultTableCellRenderer alinearCentro, alinearderecha, alinearIzquierda;
      private java.util.Date fechahoy=new Date();
      private int visualisa=0,columnavisualisa=8,ordenamiento=2,controlcombo=0,indice=0,i3=0;
      private String esquesele="all";
      bd_conexion x = new bd_conexion();
      ResultSet rs = null;
      private SimpleDateFormat formateadoresta = new SimpleDateFormat("yyyy-MM-dd");
      float totalventa=0;
    /** Creates new form articulos_sie_rep_masvenxp */
    public articulos_sie_rep_masvenxp() {
        this.iniciar_modelo_de_tabla();
        this.iniciar_modelo_apa();
        this.iniciar_modelo_compra();
        this.iniciar_modelo_fam_detxtie();
        this.iniciar_modelo_costosresumen();
        this.iniciar_modelo_compraxfam();
        this.iniciar_modelo_compraxfammes();
        initComponents();
        //x.estableceConexion();
        this.setLocation(5,5);
        this.loadcombo();
        this.buttonGroup1.setSelected(jrbtn_estemes.getModel(), true);
        this.buttonGroup2.setSelected(jrbtn_importe.getModel(), true);
        Calendar fechaini = Calendar.getInstance(); // obtiene la fecha actual
        fechaini.set(fechahoy.getYear()+1900,fechahoy.getMonth(), 1);
        this.jdc_fechainicial.setDate(fechaini.getTime());
        this.jdc_fechafinal.setDate(fechahoy);
         String arreglo_idtienda[]=this.jcbx_tiendas.getSelectedItem().toString().split(":");
        if(JOptionPane.showConfirmDialog(null, "Desea Ver Reporte Del Mes Actual, Puede tardar Unos Minutos?")==0)
            {
                this.contruir_reporte(this.jdc_fechainicial.getDate(),this.jdc_fechafinal.getDate(),ordenamiento,arreglo_idtienda[0],"0","");
            }
        jt_repmasvenprovee.getColumnModel().getColumn(0).setPreferredWidth(30);//tem ent
        jt_repmasvenprovee.getColumnModel().getColumn(1).setPreferredWidth(40);//familia
        jt_repmasvenprovee.getColumnModel().getColumn(2).setPreferredWidth(60);//subfam.
        jt_repmasvenprovee.getColumnModel().getColumn(3).setPreferredWidth(60);//id
        jt_repmasvenprovee.getColumnModel().getColumn(4).setPreferredWidth(60);//clave
        jt_repmasvenprovee.getColumnModel().getColumn(5).setPreferredWidth(35);//descrip.
        jt_repmasvenprovee.getColumnModel().getColumn(6).setPreferredWidth(35);//item
        jt_repmasvenprovee.getColumnModel().getColumn(7).setPreferredWidth(35);//precio
        jt_repmasvenprovee.getColumnModel().getColumn(8).setPreferredWidth(180);//f.ult. compra

        jt_repmasvenprovee2.getColumnModel().getColumn(0).setPreferredWidth(10);//lugar
        jt_repmasvenprovee2.getColumnModel().getColumn(1).setPreferredWidth(40);//Cantidad
        jt_repmasvenprovee2.getColumnModel().getColumn(2).setPreferredWidth(60);//importe costo venta
        jt_repmasvenprovee2.getColumnModel().getColumn(3).setPreferredWidth(50);//importe costo
        jt_repmasvenprovee2.getColumnModel().getColumn(4).setPreferredWidth(60);//Diferencia
        jt_repmasvenprovee2.getColumnModel().getColumn(5).setPreferredWidth(10);//DC
        jt_repmasvenprovee2.getColumnModel().getColumn(6).setPreferredWidth(50);//% Compra
        jt_repmasvenprovee2.getColumnModel().getColumn(7).setPreferredWidth(15);//% Acumulado
        jt_repmasvenprovee2.getColumnModel().getColumn(8).setPreferredWidth(160);//Proveedor
        jt_repmasvenprovee2.getColumnModel().getColumn(9).setPreferredWidth(15);//Pz Vendidas
        jt_repmasvenprovee2.getColumnModel().getColumn(10).setPreferredWidth(15);//% rotacion

        jt_repmasvenprovee.getTableHeader().setBackground(Color.yellow);
        this.buttonGroup3.setSelected(jrtbn_descripcion.getModel(), true);
        this.jlb_resultado.setText("");
        this.loadcomboclasif();
        this.iniciar_modelo_fam_detxtief();
        this.centrar_datos();
    }

    private void loadcomboclasif(){
    this.jcbx_clasificacion.addItem("0:General");

            try
            {
                  rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_proveed_clasif(0,0,'') as (id character varying(10),descripclasif character varying(40),clasifobser character varying(30));",variables_global.getconexiongral());
               while (rs.next())
                    {
                      this.jcbx_clasificacion.addItem(rs.getString("id")+":"+rs.getString("descripclasif"));
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
    }

        private  void ayuda()
            {
                String punto1="1.- Este Reporte muestra Ventas Por Proveedor en un rango de Fechas determinado \n";
                String punto2="2.- Cada Boton tiene Una letra Resaltada el cual indica su metodo abreviado, uselo si desea mayor rapides ( ejemplo Alt+a obtendra ayuda automaticamente)\n";
                String punto3="3.- Algunos Reportes pueden tardar Unos minutos dependiento del rango de Fechas seleccionadas. \n ";
                String punto4="4.- Pase el Puntero del Mause sobre el Elemento este le mostrara una pequeña descripcion de lo qu hace. \n ";
                JOptionPane.showMessageDialog(null,""+punto1+punto2+punto3+punto4+"", "Sistema Integral(Reporte Ventas por Proveedor) : Ayuda",1);
            }
private void iniciar_modelo_de_tabla()
    {

        jtable_modelo=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo.addColumn("<html><b>Lugar</b></html>");
        jtable_modelo.addColumn("<html><b>Cant. Piezas</b></html>");
        jtable_modelo.addColumn("<html><b>Imp.Precio Venta</b></html>");
        jtable_modelo.addColumn("<html><b>Imp. Costo</b></html>");
        jtable_modelo.addColumn("<html><b>Diferencia</b></html>");
        jtable_modelo.addColumn("<html><b>D/C</b></html>");
        jtable_modelo.addColumn("<html><b>% Venta</b></html>");
        jtable_modelo.addColumn("<html><b>% Acum.</b></html>");
        jtable_modelo.addColumn("<html><b>Proveedor");
   }
private void iniciar_modelo_compra()
    {
        jtable_modelo_compra=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_compra.addColumn("<html><b>Lugar</b></html>");
        jtable_modelo_compra.addColumn("<html><b>Cant. Piezas</b></html>");
        jtable_modelo_compra.addColumn("<html><b>Imp.costo Venta</b></html>");
        jtable_modelo_compra.addColumn("<html><b>Imp.Costo</b></html>");
        jtable_modelo_compra.addColumn("<html><b>Dif</b></html>");
        jtable_modelo_compra.addColumn("<html><b>D/C</b></html>");
        jtable_modelo_compra.addColumn("<html><b>Tienda</b></html>");
        jtable_modelo_compra.addColumn("<html><b>Clasif.Proveedor</b></html>");
        jtable_modelo_compra.addColumn("<html><b>Proveedor");
        jtable_modelo_compra.addColumn("<html><b>Pz Vent.");
        jtable_modelo_compra.addColumn("<html><b>Rotacion");
   }
private void iniciar_modelo_apa()
    {

        jtable_modelo_apa=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_apa.addColumn("<html><b>Lugar</b></html>");
        jtable_modelo_apa.addColumn("<html><b>Cant. Piezas</b></html>");
        jtable_modelo_apa.addColumn("<html><b>Imp.Precio Venta</b></html>");
        jtable_modelo_apa.addColumn("<html><b>Imp. Costo</b></html>");
        jtable_modelo_apa.addColumn("<html><b>Diferencia</b></html>");
        jtable_modelo_apa.addColumn("<html><b>D/C</b></html>");
        jtable_modelo_apa.addColumn("<html><b>% Venta</b></html>");
        jtable_modelo_apa.addColumn("<html><b>% Acum.</b></html>");
        jtable_modelo_apa.addColumn("<html><b>Proveedor");
   }
private void iniciar_modelo_costosresumen()
    {

        jtable_modelo_resumencostos=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_resumencostos.addColumn("<html><b>Concepto</b></html>");
        jtable_modelo_resumencostos.addColumn("<html><b>piezas</b></html>");
        jtable_modelo_resumencostos.addColumn("<html><b>Costo</b></html>");
        jtable_modelo_resumencostos.addColumn("<html><b>Precio</b></html>");
        jtable_modelo_resumencostos.addColumn("<html><b>Utilidad</b></html>");
   }
private void iniciar_modelo_fam_detxtie()
    {
        int numerotiendas=this.jtable_tiendas.getRowCount(),ii=0,idtienda=0,ndias=0;
        jtable_modelo_detxtie=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_detxtie.addColumn("Tienda O/Tienda Dest.");
        for(int i=0;i<numerotiendas;i++)
           {
                 jtable_modelo_detxtie.addColumn("<html><b>"+this.jtable_tiendas.getValueAt(i,1).toString()+":"+this.jtable_tiendas.getValueAt(i,0).toString()+"</b></html>");
           }
        jtable_modelo_detxtie.addColumn("Total");
  
    }
private void iniciar_modelo_compraxfam()
    {
        jtable_modelo_compraxfam=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_compraxfam.addColumn("<html><b>Familia</b></html>");
        jtable_modelo_compraxfam.addColumn("<html><b>Proveedor</b></html>");
        jtable_modelo_compraxfam.addColumn("<html><b>Clasif. Proveedor</b></html>");
        jtable_modelo_compraxfam.addColumn("<html><b>Cant. Piezas</b></html>");
        jtable_modelo_compraxfam.addColumn("<html><b>Imp.costo Venta</b></html>");
        jtable_modelo_compraxfam.addColumn("<html><b>Imp.Costo</b></html>");
        jtable_modelo_compraxfam.addColumn("<html><b>Dif</b></html>");
        jtable_modelo_compraxfam.addColumn("<html><b>Tienda</b></html>");

   }
private void iniciar_modelo_compraxfammes()
    {
        jtable_modelo_compraxfammes=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_compraxfammes.addColumn("<html><b>Familia</b></html>");
        jtable_modelo_compraxfammes.addColumn("<html><b>Proveedor</b></html>");
        jtable_modelo_compraxfammes.addColumn("<html><b>Clasif. Proveedor</b></html>");
        jtable_modelo_compraxfammes.addColumn("01-2013");
        jtable_modelo_compraxfammes.addColumn("02-2013");
        jtable_modelo_compraxfammes.addColumn("03-2013");
        jtable_modelo_compraxfammes.addColumn("04-2013");
        jtable_modelo_compraxfammes.addColumn("05-2013");
        jtable_modelo_compraxfammes.addColumn("06-2013");
        jtable_modelo_compraxfammes.addColumn("07-2013");
        jtable_modelo_compraxfammes.addColumn("08-2013");
        jtable_modelo_compraxfammes.addColumn("09-2013");
        jtable_modelo_compraxfammes.addColumn("10-2013");
        jtable_modelo_compraxfammes.addColumn("11-2013");
        jtable_modelo_compraxfammes.addColumn("12-2013");

   }
private void iniciar_modelo_fam_detxtief()
    {
        int numerotiendas=this.jtable_tiendas.getRowCount(),ii=0,idtienda=0,ndias=0;

     Object[] fnewRow = new Object[ numerotiendas+2];
     for(int i=0;i<numerotiendas;i++)
           {
            fnewRow[0]=this.jtable_tiendas.getValueAt(i,1).toString()+":"+this.jtable_tiendas.getValueAt(i,0).toString();
            for( ii=1;ii<numerotiendas+1;ii++)
                {
                    fnewRow[ii]="0";
                }
             jtable_modelo_detxtie.addRow(fnewRow);
            }
            fnewRow[0]="Totales";
            for( ii=1;ii<numerotiendas+1;ii++)
                {
                    fnewRow[ii]="0";
                }
             jtable_modelo_detxtie.addRow(fnewRow);

    }

public void centrar_datos()
    {
        alinearderecha = new DefaultTableCellRenderer();
        alinearderecha.setHorizontalAlignment(SwingConstants.RIGHT);
        int ii=0,numerotiendas=0;
                            numerotiendas=this.jtable_modelo.getColumnCount();
                            for(ii=1;ii<numerotiendas-1;ii++)
                                {
                                    jt_repmasvenprovee.getColumnModel().getColumn(ii).setCellRenderer(alinearderecha);
                                }

                            numerotiendas=this.jtable_modelo_apa.getColumnCount();
                            for(ii=1;ii<numerotiendas-1;ii++)
                                {
                                    jt_repmasvenprovee1.getColumnModel().getColumn(ii).setCellRenderer(alinearderecha);
                                }
                            numerotiendas=this.jtable_modelo_compra.getColumnCount();
                            for(ii=1;ii<numerotiendas-3;ii++)
                                {
                                    jt_repmasvenprovee2.getColumnModel().getColumn(ii).setCellRenderer(alinearderecha);
                                }

                            numerotiendas=this.jtable_modelo_detxtie.getColumnCount();
                            for(ii=1;ii<numerotiendas;ii++)
                                {
                                    jtb_repxfamiliasxtienda.getColumnModel().getColumn(ii).setCellRenderer(alinearderecha);
                                }




    }

private void contruir_reporte(Date fechai,Date fecha,int ordena,String idesq,String busca6,String busca7)
    {
        //fecha es la final del reporte
         DefaultCategoryDataset dataset = new DefaultCategoryDataset();//detalle por tienda
         String titulografico="",titulograficoh="",ti="";

        while(jtable_modelo.getRowCount()>0)jtable_modelo.removeRow(0);
        DecimalFormat miformat = new DecimalFormat("############");
        DecimalFormat miformat2 = new DecimalFormat("###,###,###,###");
        int ii=0,idtienda=0,ndias=0,reg=0,noaten=0;
        //indicamos 7 columnas
        Object valtie = null;
       

        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");

        String pFechai = formato.format(fechai);//fecha final de reporte
        String pFecha = formato.format(fecha);//fecha final de reporte
        String serie1="",tienda="",texto="select * from x1ventasxproveedorv2(3,'"+idesq+"',"+ordena+",'"+pFechai+"','"+pFecha+"','"+busca6+"','') as (id integer, can real,importe double precision,importecosto double precision,utilidad double precision,nom character varying(50),clasif character varying(10));";

        float importe=0,totalpiezas=0,totcosto=0,totutili=0,totporcen=0,totporcenacum=0,importe2=0,importe3=0;
        System.out.println(texto);
        
        int rankin=0;
               try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                       // if(rs.getString("clasif")!=null)
                            //{
                                rankin++;
                                totalpiezas+=rs.getFloat("can");
                                importe+=rs.getFloat("importe");
                                totcosto+=rs.getFloat("importecosto");
                                totutili+=rs.getFloat("utilidad");
                                jtable_modelo.addRow(new Object[]{rankin,miformat.format(rs.getFloat("can")),miformat2.format(rs.getFloat("importe")),miformat2.format(rs.getFloat("importecosto")),miformat2.format(rs.getFloat("utilidad")),miformat.format((rs.getFloat("utilidad")/rs.getFloat("importecosto"))*100),0,0,rs.getString ("id")+":"+rs.getString ("nom")});
                            //}
                        }
                        
                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }

            jtable_modelo.addRow(new Object[]{"<html><h3><b>Totales: "+"</b></h3></html>","<html><h3><b>"+miformat.format(totalpiezas)+"</b></h3></html>","<html><h3><b>"+miformat.format(importe)+"</b></h3></html>","<html><h3><b>"+miformat.format(totcosto)+"</b></h3></html>","<html><h3><b>"+miformat.format(totutili)+"</b></h3></html>","<html><h3><b>"+miformat.format((totutili/totcosto)*100)+"</b></h3></html>",0,0,""});
            totalventa=importe;
            this.jtf_totalventa.setText(miformat.format(importe));
            titulografico="Grafica Ventas X Proveedor : "+this.fechaeuropea(fechai)+" A " + this.fechaeuropea(fecha)+" Total="+miformat.format(importe)+"";

            variables_global.settitulografica_artmasvxp(titulografico);

            int numerofilas=this.jtable_modelo.getRowCount()-1;
             rankin=0;
             for(int i = 0 ;i < numerofilas; i++)
                {
                 valtie=this.jtable_modelo.getValueAt(i,2);
                 serie1=this.jtable_modelo.getValueAt(i,8).toString();

                 importe2=Float.valueOf(valtie.toString().replace(",","").replace(".",""));
                 totporcen=(Float.valueOf(valtie.toString().replace(",","").replace(".",""))/importe)*100;
                 totporcenacum+=totporcen;
                 jtable_modelo.setValueAt(miformat.format(totporcen)+"%",i,6);
                 jtable_modelo.setValueAt(miformat.format(totporcenacum)+"%",i,7);
                 if (serie1.length()>12)
                        {
                            serie1=serie1.substring(0, 12);
                        }

                 if(totporcenacum < 91)
                        {
                            dataset.addValue(importe2,this.jtable_modelo.getValueAt(i,0).toString()+"="+serie1,"Sub Familias");
                             rankin++;
                        }
                 else
                        {
                            importe3+=importe2;
                        }
                 }
                 dataset.addValue(importe3, rankin+" sub Familias 10% Restantes","Sub Familias");

                 variables_global.setdatasetarmasvp(dataset);
                 this.jlbl_cantidadregistros.setText(String.valueOf(this.jtable_modelo.getRowCount()));
 }
private void contruir_totalestraspasos()
    {
         DecimalFormat myFormatter = new DecimalFormat("###,###,###");
         float totalve=0,totalve2=0;
          int totalfilasreporte=this.jtable_modelo_detxtie.getRowCount()-1,i=0,ii=0,numerotiendas=this.jtable_modelo_detxtie.getColumnCount();
           for(i=0;i<totalfilasreporte;i++)
                  {
                        for( ii=1;ii<numerotiendas-1;ii++)
                            {
                                totalve+=Float.valueOf(jtable_modelo_detxtie.getValueAt(i, ii).toString().replace(",","").replace(".",""));
                            }
                        //jtable_modelo_detxtie.setValueAt("<html><h3><b>"+myFormatter.format(totalve)+"</b></h3></html>",i,ii+1);
                        jtable_modelo_detxtie.setValueAt(""+myFormatter.format(totalve)+"",i,ii);
                        totalve=0;
                  }
            totalve=0;
           for( ii=1;ii<numerotiendas;ii++)
            {
             totalve=0;
                for(i=0;i<totalfilasreporte;i++)
                    {
                        totalve+=Float.valueOf(jtable_modelo_detxtie.getValueAt(i, ii).toString().replace(",","").replace(".",""));
                    }
                    jtable_modelo_detxtie.setValueAt("<html><h3><b>"+myFormatter.format(totalve)+"</b></h3></html>",i,ii);
                    //jtable_modelo_detxtie.setValueAt(""+myFormatter.format(totalve)+"",i,ii+1);
            }
     }
private void contruir_totaleslimpios()
    {
         DecimalFormat myFormatter = new DecimalFormat("###,###,###");
         float totalve=0,totalve2=0;
         Object[] fnewRow = new Object[jtable_modelo_detxtie.getColumnCount()];
         int totalfilasreporte=this.jtable_modelo_detxtie.getRowCount(),i=0,ii=0,numerotiendas=this.jtable_modelo_detxtie.getColumnCount();
           for(i=0;i<totalfilasreporte;i++)
                  {
                        for( ii=1;ii<numerotiendas;ii++)
                            {

                                jtable_modelo_detxtie.setValueAt("0",i,ii);
                            }
                        //jtable_modelo_detxtie.setValueAt("<html><h3><b>"+myFormatter.format(totalve)+"</b></h3></html>",i,ii+1);
                        //jtable_modelo_detxtie.setValueAt("0",i,ii);
                        totalve=0;
                  }
            totalve=0;
          /* for( ii=1;ii<numerotiendas;ii++)
            {
             totalve=0;
                for(i=0;i<totalfilasreporte;i++)
                    {
                        jtable_modelo_detxtie.setValueAt("0",i,ii+1);
                    }
                     //   jtable_modelo_detxtie.setValueAt("0",i,ii);
                    //jtable_modelo_detxtie.setValueAt(""+myFormatter.format(totalve)+"",i,ii+1);
            }*/
     }


private void contruir_reporte_apa(Date fechai,Date fecha,int ordena,String idesq)
    {
        //fecha es la final del reporte
         DefaultCategoryDataset dataset = new DefaultCategoryDataset();//detalle por tienda
         String titulografico="",titulograficoh="",ti="";

        while(jtable_modelo_apa.getRowCount()>0)jtable_modelo_apa.removeRow(0);
        DecimalFormat miformat = new DecimalFormat("###,###,###,###");
        int ii=0,idtienda=0,ndias=0,reg=0,noaten=0;
        //indicamos 7 columnas
        Object valtie = null;
             SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");
        String pFechai = formato.format(fechai);//fecha final de reporte
        String pFecha = formato.format(fecha);//fecha final de reporte
        String serie1="",tienda="",texto="select * from x1ventasxproveedorv2(2,'"+idesq+"',"+ordena+",'"+pFechai+"','"+pFecha+"') as (id integer, can bigint,importe double precision,importecosto numeric,utilidad double precision,nom character varying(50));";

   System.out.println(texto);



        float importe=0,totalpiezas=0,totcosto=0,totutili=0,totporcen=0,totporcenacum=0,importe2=0,importe3=0;

        int rankin=0;
               try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                            rankin++;
                            totalpiezas+=rs.getFloat(2);
                            importe+=rs.getFloat(3);
                            totcosto+=rs.getFloat(4);
                            totutili+=rs.getFloat(5);
                            jtable_modelo_apa.addRow(new Object[]{rankin,miformat.format(rs.getFloat(2)),miformat.format(rs.getFloat(3)),miformat.format(rs.getFloat(4)),miformat.format(rs.getFloat(5)),miformat.format((rs.getFloat(5)/rs.getFloat(4))*100),0,0,rs.getString (1)+":"+rs.getString (6)});
                        }
                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }

            jtable_modelo_apa.addRow(new Object[]{"<html><h3><b>Totales: "+"</b></h3></html>","<html><h3><b>"+miformat.format(totalpiezas)+"</b></h3></html>","<html><h3><b>"+miformat.format(importe)+"</b></h3></html>","<html><h3><b>"+miformat.format(totcosto)+"</b></h3></html>","<html><h3><b>"+miformat.format(totutili)+"</b></h3></html>","<html><h3><b>"+miformat.format((totutili/totcosto)*100)+"</b></h3></html>",0,0,""});
            this.jtf_totalapartado.setText(miformat.format(importe));
            this.jtf_total.setText(miformat.format(importe+totalventa));

            titulografico="Grafica Ventas X Proveedor : "+this.fechaeuropea(fechai)+" A " + this.fechaeuropea(fecha)+" Total="+miformat.format(importe)+"";

             int numerofilas=this.jtable_modelo_apa.getRowCount()-1;
             rankin=0;
             for(int i = 0 ;i < numerofilas; i++)
                {
                 valtie=this.jtable_modelo_apa.getValueAt(i,2);
                 serie1=this.jtable_modelo_apa.getValueAt(i,8).toString();

                 importe2=Float.valueOf(valtie.toString().replace(",","").replace(".",""));
                 totporcen=(Float.valueOf(valtie.toString().replace(",","").replace(".",""))/importe)*100;
                 totporcenacum+=totporcen;
                 jtable_modelo_apa.setValueAt(miformat.format(totporcen)+"%",i,6);
                 jtable_modelo_apa.setValueAt(miformat.format(totporcenacum)+"%",i,7);

                 }

                 this.jlbl_cantidadregistros1.setText(String.valueOf(this.jtable_modelo_apa.getRowCount()));
 }

private void contruir_reporte_compra(Date fechai,Date fecha,int ordena,String idesq,String busca6,String busca7)
    {
        //fecha es la final del reporte
         DefaultCategoryDataset dataset = new DefaultCategoryDataset();//detalle por tienda
        //while(jtable_modelo_compra.getRowCount()>0)jtable_modelo_compra.removeRow(0);
        DecimalFormat miformat = new DecimalFormat("############");
        DecimalFormat miformat2 = new DecimalFormat("###,###,###,###");
        int ii=0,j=0;
        //indicamos 7 columnas
        Object valtie = null;


        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");

        String pFechai = formato.format(fechai);//fecha final de reporte
        String pFecha = formato.format(fecha);//fecha final de reporte
        String serie1="",mesactual[]=null,codigo[]=null,texto="select * from x1distribucion_terminados_distribucion_xcliente(6,'"+idesq+"',"+ordena+",'"+pFechai+"','"+pFecha+"','"+busca6+"','') as (id character varying(12), can numeric,importe numeric,importecosto numeric,utilidad numeric,nom character varying(60),clasif character varying(10),idfam smallint,descla character varying(40));";

        float importe=0,totalpiezas=0,totcosto=0,totutili=0,totporcen=0,totporcenacum=0,importe2=0,importe3=0,pzv=0,pzc=0;
        System.out.println(texto);

        int rankin=0;
               try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                       // if(rs.getString("clasif")!=null)
                            //{
                                rankin++;
                                totalpiezas+=rs.getFloat("can");
                                importe+=rs.getFloat("importe");
                                totcosto+=rs.getFloat("importecosto");
                                totutili+=rs.getFloat("utilidad");
                                jtable_modelo_compra.addRow(new Object[]{rankin,miformat.format(rs.getFloat("can")),miformat2.format(rs.getFloat("importe")),miformat2.format(rs.getFloat("importecosto")),miformat2.format(rs.getFloat("utilidad")),miformat.format((rs.getFloat("utilidad")/rs.getFloat("importecosto"))*100),this.jcbx_tiendas.getSelectedItem(),rs.getString("descla"),rs.getString("id")+":"+rs.getString("idfam")+":"+rs.getString("nom"),"0","0"});
                            //}
                        }

                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }
 if(this.jcbx_detallecostos.isSelected()==false)
 {
        for( ii=0;ii<this.jtable_modelo_compra.getRowCount()-1;ii++)
                {
                if(jtable_modelo_compra.getValueAt(ii, 8).toString().length()>0)
                    {
                    mesactual=jtable_modelo_compra.getValueAt(ii, 8).toString().split(":");
                    pzc=Float.valueOf(jtable_modelo_compra.getValueAt(ii, 1).toString());
                    for( j=0;j<this.jtable_modelo.getRowCount();j++)
                        {
                         codigo=jtable_modelo.getValueAt(j, 8).toString().split(":");
                        if (mesactual[1].equals(codigo[0]))
                            {

                                jtable_modelo_compra.setValueAt(jtable_modelo.getValueAt(j, 1).toString(),ii,9);//descripcion
                                pzv=Float.valueOf(jtable_modelo.getValueAt(j, 1).toString());
                                jtable_modelo_compra.setValueAt(miformat.format((pzv/pzc)*100)+"%",ii,10);//rotacion
                                j=this.jtable_modelo.getRowCount();
                            }
                        }
                    }
                }
 }
            jtable_modelo_compra.addRow(new Object[]{"<html><h3><b>"+busca7+"=Totales: "+"</b></h3></html>","<html><h3><b>"+miformat.format(totalpiezas)+"</b></h3></html>","<html><h3><b>"+miformat.format(importe)+"</b></h3></html>","<html><h3><b>"+miformat.format(totcosto)+"</b></h3></html>","<html><h3><b>"+miformat.format(totutili)+"</b></h3></html>","<html><h3><b>"+miformat.format((totutili/totcosto)*100)+"</b></h3></html>",0,0,""});
            //totalventa=importe;
            //this.jtf_totalventa.setText(miformat.format(importe));
            //titulografico="Grafica Ventas X Proveedor : "+this.fechaeuropea(fechai)+" A " + this.fechaeuropea(fecha)+" Total="+miformat.format(importe)+"";

            //variables_global.settitulografica_artmasvxp(titulografico);

            /*int numerofilas=this.jtable_modelo_compra.getRowCount()-1;
             rankin=0;
             for(int i = 0 ;i < numerofilas; i++)
                {
                 valtie=this.jtable_modelo_compra.getValueAt(i,2);
                 serie1=this.jtable_modelo_compra.getValueAt(i,8).toString();

                 importe2=Float.valueOf(valtie.toString().replace(",","").replace(".",""));
                 totporcen=(Float.valueOf(valtie.toString().replace(",","").replace(".",""))/importe)*100;
                 totporcenacum+=totporcen;
                 jtable_modelo_compra.setValueAt(miformat.format(totporcen)+"%",i,6);
                 jtable_modelo_compra.setValueAt(miformat.format(totporcenacum)+"%",i,7);
                 if (serie1.length()>12)
                        {
                            serie1=serie1.substring(0, 12);
                        }

                 if(totporcenacum < 91)
                        {
                            dataset.addValue(importe2,this.jtable_modelo_compra.getValueAt(i,0).toString()+"="+serie1,"Sub Familias");
                             rankin++;
                        }
                 else
                        {
                            importe3+=importe2;
                        }
                 }
             */
             /*
                 dataset.addValue(importe3, rankin+" sub Familias 10% Restantes","Sub Familias");

                 variables_global.setdatasetarmasvp(dataset);
             */
                jtable_modelo_compra.addRow(new Object[]{"<html><BODY bgcolor=#CC0066><font color=#CC0066>______________________</font></BODY></html>","<html><BODY bgcolor=#CC0066><font color=#CC0066>______________________</font></BODY></html>","<html><BODY bgcolor=#CC0066><font color=#CC0066>______________________</font></BODY></html>","<html><BODY bgcolor=#CC0066><font color=#CC0066>______________________</font></BODY></html>","<html><BODY bgcolor=#CC0066><font color=#CC0066>______________________</font></BODY></html>","<html><BODY bgcolor=#CC0066><font color=#CC0066>______________________</font></BODY></html>"});
                 this.jlbl_cantidadregistros.setText(String.valueOf(this.jtable_modelo_compra.getRowCount()));
             
 }
private void contruir_reporte_compracompleta(Date fechai,Date fecha,int ordena,String idesq,String busca6,String busca7)
    {
        //fecha es la final del reporte
         DefaultCategoryDataset dataset = new DefaultCategoryDataset();//detalle por tienda
        //while(jtable_modelo_compra.getRowCount()>0)jtable_modelo_compra.removeRow(0);
        DecimalFormat miformat = new DecimalFormat("############");
        DecimalFormat miformat2 = new DecimalFormat("###,###,###,###");
        int ii=0,j=0;
        //indicamos 7 columnas
        Object valtie = null;


        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");

        String pFechai = formato.format(fechai);//fecha final de reporte
        String pFecha = formato.format(fecha);//fecha final de reporte
        String serie1="",mesactual[]=null,codigo[]=null,texto="select * from x1distribucion_terminados_distribucion_xcliente(9,'"+idesq+"',"+ordena+",'"+pFechai+"','"+pFecha+"','"+busca6+"','') as (idcli character varying(12),id character varying(12), can numeric,importe numeric,importecosto numeric,utilidad numeric,nom character varying(60),clasif character varying(10),idfam smallint,descla character varying(40),nomcli character varying(60));";

        float importe=0,totalpiezas=0,totcosto=0,totutili=0,totporcen=0,totporcenacum=0,importe2=0,importe3=0,pzv=0,pzc=0;
        System.out.println(texto);

        int rankin=0;
               try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                                rankin++;
                                totalpiezas+=rs.getFloat("can");
                                importe+=rs.getFloat("importe");
                                totcosto+=rs.getFloat("importecosto");
                                totutili+=rs.getFloat("utilidad");
                                jtable_modelo_compra.addRow(new Object[]{rankin,miformat.format(rs.getFloat("can")),miformat2.format(rs.getFloat("importe")),miformat2.format(rs.getFloat("importecosto")),miformat2.format(rs.getFloat("utilidad")),miformat.format((rs.getFloat("utilidad")/rs.getFloat("importecosto"))*100),rs.getString("nomcli"),rs.getString("descla"),rs.getString("id")+":"+rs.getString("idfam")+":"+rs.getString("nom"),"",""});
                        }

                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }

            jtable_modelo_compra.addRow(new Object[]{"<html><h3><b>Totales: </b></h3></html>","<html><h3><b>"+miformat.format(totalpiezas)+"</b></h3></html>","<html><h3><b>"+miformat.format(importe)+"</b></h3></html>","<html><h3><b>"+miformat.format(totcosto)+"</b></h3></html>","<html><h3><b>"+miformat.format(totutili)+"</b></h3></html>","<html><h3><b>"+miformat.format((totutili/totcosto)*100)+"</b></h3></html>",0,0,""});
}
private void contruir_reporte_compraxfam(Date fechai,Date fecha,int ordena,String idesq,String busca6,String busca7)
    {
        //fecha es la final del reporte
         DefaultCategoryDataset dataset = new DefaultCategoryDataset();//detalle por tienda
        //while(jtable_modelo_compra.getRowCount()>0)jtable_modelo_compra.removeRow(0);
        DecimalFormat miformat = new DecimalFormat("############");
        DecimalFormat miformat2 = new DecimalFormat("###,###,###,###");
        int ii=0,j=0;
        //indicamos 7 columnas
        Object valtie = null;


        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");

        String pFechai = formato.format(fechai);//fecha final de reporte
        String pFecha = formato.format(fecha);//fecha final de reporte
        String serie1="",mesactual[]=null,codigo[]=null,texto="select * from x1distribucion_terminados_distribucion_xcliente(7,'"+idesq+"',"+ordena+",'"+pFechai+"','"+pFecha+"','"+busca6+"','') as (id character varying(12), can numeric,importe numeric,importecosto numeric,utilidad numeric,nom character varying(60),clasif character varying(10),idfam smallint,descla character varying(40),fam character varying(40));";

        float importe=0,totalpiezas=0,totcosto=0,totutili=0,totporcen=0,totporcenacum=0,importe2=0,importe3=0,pzv=0,pzc=0;
        System.out.println(texto);

        int rankin=0;
               try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                       // if(rs.getString("clasif")!=null)
                            //{
                                rankin++;
                                totalpiezas+=rs.getFloat("can");
                                importe+=rs.getFloat("importe");
                                totcosto+=rs.getFloat("importecosto");
                                totutili+=rs.getFloat("utilidad");
                                jtable_modelo_compraxfam.addRow(new Object[]{rs.getString("fam"),rs.getString("idfam")+":"+rs.getString("nom"),rs.getString("descla"),miformat.format(rs.getFloat("can")),miformat2.format(rs.getFloat("importe")),miformat2.format(rs.getFloat("importecosto")),miformat2.format(rs.getFloat("utilidad")),busca7});
                            //}
                        }

                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }
 
            jtable_modelo_compraxfam.addRow(new Object[]{"","<html><h3><b>Totales: "+"</b></h3></html>","","<html><h3><b>"+miformat.format(totalpiezas)+"</b></h3></html>","<html><h3><b>"+miformat.format(importe)+"</b></h3></html>","<html><h3><b>"+miformat.format(totcosto)+"</b></h3></html>","<html><h3><b>"+miformat.format(totutili)+"</b></h3></html>",busca7});

 }
private void contruir_reporte_compraxfamxmes(Date fechai,Date fecha,int ordena,String idesq,String busca6,String busca7)
    {
        //fecha es la final del reporte
         DefaultCategoryDataset dataset = new DefaultCategoryDataset();//detalle por tienda
        //while(jtable_modelo_compra.getRowCount()>0)jtable_modelo_compra.removeRow(0);
        DecimalFormat miformat = new DecimalFormat("############");
        DecimalFormat miformat2 = new DecimalFormat("###,###,###,###");
        int ii=0,j=0,columnatitulo=0;
        //indicamos 7 columnas
        Object valtie = null;


        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");

        String pFechai = formato.format(fechai);//fecha final de reporte
        String pFecha = formato.format(fecha);//fecha final de reporte
        String serie1="",mesactual[]=null,codigo[]=null,texto="select * from x1distribucion_terminados_distribucion_xcliente(10,'"+idesq+"',"+ordena+",'"+pFechai+"','"+pFecha+"','"+busca6+"','') as (fechames text,id character varying(12), can numeric,importe numeric,importecosto numeric,utilidad numeric,nom character varying(60),clasif character varying(10),idfam smallint,descla character varying(40),fam character varying(40));";

        float importe=0,totalpiezas=0,totcosto=0,totutili=0,totporcen=0,totporcenacum=0,importe2=0,importe3=0,pzv=0,pzc=0;
        System.out.println(texto);

        int rankin=0;
               try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                            columnatitulo=this.findcolumna_idmes(rs.getString("fechames"));
                            System.out.println("encontre mes:"+columnatitulo);
                            if(columnatitulo>0)
                                {
                                    this.crea_hoja_compraxmes(rs.getString("fam"), rs.getString("id"),columnatitulo, miformat.format(rs.getFloat("importecosto")), rs.getString("fam"), rs.getString("nom"), rs.getString("descla"));
                                }
                        }

                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }


 }

private void contruir_reporte_compraxfamtodosclientes(Date fechai,Date fecha,int ordena,String idesq,String busca6,String busca7)
    {
        //fecha es la final del reporte
         DefaultCategoryDataset dataset = new DefaultCategoryDataset();//detalle por tienda
        //while(jtable_modelo_compra.getRowCount()>0)jtable_modelo_compra.removeRow(0);
        DecimalFormat miformat = new DecimalFormat("############");
        DecimalFormat miformat2 = new DecimalFormat("###,###,###,###");
        int ii=0,j=0;
        //indicamos 7 columnas
        Object valtie = null;


        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");

        String pFechai = formato.format(fechai);//fecha final de reporte
        String pFecha = formato.format(fecha);//fecha final de reporte
        String serie1="",mesactual[]=null,codigo[]=null,texto="select * from x1distribucion_terminados_distribucion_xcliente(8,'"+idesq+"',"+ordena+",'"+pFechai+"','"+pFecha+"','"+busca6+"','') as (idclie character varying(12),id character varying(12), can numeric,importe numeric,importecosto numeric,utilidad numeric,nom character varying(60),clasif character varying(10),idfam smallint,descla character varying(40),fam character varying(40),descli character varying(60));";

        float importe=0,totalpiezas=0,totcosto=0,totutili=0,totporcen=0,totporcenacum=0,importe2=0,importe3=0,pzv=0,pzc=0;
        System.out.println(texto);

        int rankin=0;
               try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                       // if(rs.getString("clasif")!=null)
                            //{
                                rankin++;
                                totalpiezas+=rs.getFloat("can");
                                importe+=rs.getFloat("importe");
                                totcosto+=rs.getFloat("importecosto");
                                totutili+=rs.getFloat("utilidad");
                                jtable_modelo_compraxfam.addRow(new Object[]{rs.getString("fam"),rs.getString("idfam")+":"+rs.getString("nom"),rs.getString("descla"),miformat.format(rs.getFloat("can")),miformat2.format(rs.getFloat("importe")),miformat2.format(rs.getFloat("importecosto")),miformat2.format(rs.getFloat("utilidad")),rs.getString("descli")});
                            //}
                        }

                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }

            jtable_modelo_compraxfam.addRow(new Object[]{"","<html><h3><b>Totales: "+"</b></h3></html>","","<html><h3><b>"+miformat.format(totalpiezas)+"</b></h3></html>","<html><h3><b>"+miformat.format(importe)+"</b></h3></html>","<html><h3><b>"+miformat.format(totcosto)+"</b></h3></html>","<html><h3><b>"+miformat.format(totutili)+"</b></h3></html>",busca7});

 }


private void contruir_reporte_trapasos(Date fechai,Date fecha,int opcion)
    {
        //while(jtable_modelo_detxtie.getRowCount()>0)jtable_modelo_detxtie.removeRow(0);
        DecimalFormat miformat = new DecimalFormat("############.##");

        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");
        //while(jtable_modelo_detxtie.getRowCount()>0)jtable_modelo_detxtie.removeRow(0);
        String pFechai = formato.format(fechai);//fecha final de reporte
        String pFecha = formato.format(fecha);//fecha final de reporte
        String texto="select * from x1sieuno_articulo_traspasos_estadisticas("+opcion+",'"+pFechai+"','"+pFecha+"','','') as (can real,costo real,idtiendaori integer,idtiendadest integer);";

         System.out.println(texto);
        int columnatitulo=0;
               try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                                 columnatitulo=this.findcolumna_idtienda(rs.getString("idtiendadest"));
                                //jtable_modelo.addRow(new Object[]{rankin,miformat.format(rs.getFloat(2)),miformat.format(rs.getFloat(3)),miformat.format(rs.getFloat(4)),miformat.format(rs.getFloat(5)),miformat.format((rs.getFloat(5)/rs.getFloat(4))*100),0,0,rs.getString (1)+":"+rs.getString (6)});
                                 if(rs.getFloat("costo")>0)
                                 {
                                    this.crea_hoja_traspaso(rs.getString("idtiendaori"), miformat.format(rs.getFloat("costo")), columnatitulo);
                                 }
                        }

                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }
this.contruir_totalestraspasos();

 }
private void crea_hoja_traspaso(String idorigen,String costo,int columna)
    {
        DecimalFormat miformat = new DecimalFormat("############");
        int numerofilas=this.jtable_modelo_detxtie.getRowCount();
        String idstat[]=null;
        int numerocolumnas=this.jtable_modelo_detxtie.getColumnCount(),ii=00;
        int encontrado=0;
        Object[] fnewRow = new Object[numerocolumnas];
        float cantifam=0;
       //invoco al metodo que trae el recordset de datos
        cantifam=Float.valueOf(costo);
        for( ii=0;ii<numerofilas;ii++)
                {
                    idstat=jtable_modelo_detxtie.getValueAt(ii, 0).toString().split(":");
                    if (idstat[0].equals(idorigen))
                        {
                            encontrado=1;
                            jtable_modelo_detxtie.setValueAt(miformat.format(cantifam),ii ,columna);
                        }
                }

    }
private void crea_hoja_compraxmes(String idfam,String idprov,int columna,String costo,String fam,String subf,String clasi)
    {
        DecimalFormat miformat = new DecimalFormat("############");
        String idfamt="",idsubt[]=null;
        int ii=0,encontrado=0;
        Object[] fnewRow = new Object[this.jtable_modelo_compraxfammes.getColumnCount()];
        float cantifam=0;
       //invoco al metodo que trae el recordset de datos
        cantifam=Float.valueOf(costo);
        for( ii=0;ii<this.jtable_modelo_compraxfammes.getRowCount();ii++)
                {
                    idfamt=jtable_modelo_compraxfammes.getValueAt(ii, 0).toString();
                    idsubt=jtable_modelo_compraxfammes.getValueAt(ii, 1).toString().split(":");
                    if ((idfamt.equals(idfam)) && (idsubt[0].equals(idprov)))
                        {
                            encontrado=1;
                            jtable_modelo_compraxfammes.setValueAt(miformat.format(cantifam),ii ,columna);
                        }
                }
                if(encontrado==0)
                {
                    fnewRow[0]=idfam;
                    fnewRow[1]=idprov+":"+subf;
                    fnewRow[2]=clasi;
                     for( ii=3;ii<this.jtable_modelo_compraxfammes.getColumnCount();ii++)
                        {
                            fnewRow[ii]="0";
                        }
                    fnewRow[columna]=miformat.format(cantifam);
                    jtable_modelo_compraxfammes.addRow(fnewRow);
                }
    }


private void contruir_reporte_costos(Date fechai,Date fecha,int ordena,String idesq,String busca6,String busca7)
    {
        //fecha es la final del reporte
         DefaultCategoryDataset dataset = new DefaultCategoryDataset();//detalle por tienda
         String titulografico="",titulograficoh="",ti="";

        while(jtable_modelo_resumencostos.getRowCount()>0)jtable_modelo_resumencostos.removeRow(0);
        DecimalFormat miformat = new DecimalFormat("###,###,###,###");
        int ii=0,idtienda=0,ndias=0,reg=0,noaten=0;
        //indicamos 7 columnas
        Object valtie = null;


        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");

        String pFechai = formato.format(fechai);//fecha final de reporte
        String pFecha = formato.format(fecha);//fecha final de reporte
        String serie1="",tienda="",texto="select * from x1ventas_costos(1,'"+idesq+"',"+ordena+",'"+pFechai+"','"+pFecha+"','"+busca6+"','') as (can real,importe double precision,importecosto double precision,utilidad double precision);";

        float importe=0,totalpiezas=0,totcosto=0,totutili=0,importe1=0,devcan=0,devcos=0,devpre=0;
        System.out.println(texto);
               try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                                totalpiezas+=rs.getFloat("can");
                                importe+=rs.getFloat("importe");
                                totcosto+=rs.getFloat("importecosto");
                                totutili+=rs.getFloat("utilidad");
                                jtable_modelo_resumencostos.addRow(new Object[]{"1:VENTAS",miformat.format(rs.getFloat("can")),miformat.format(rs.getFloat("importecosto")),miformat.format(rs.getFloat("importe")),miformat.format(rs.getFloat("utilidad"))});
                         }

                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }
                     //costo de apartados
              texto="select * from x1ventas_costos(2,'"+idesq+"',"+ordena+",'"+pFechai+"','"+pFecha+"','"+busca6+"','') as (can bigint,importe double precision,importecosto numeric,utilidad double precision);";
              try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                                totalpiezas+=rs.getFloat("can");
                                //importe+=rs.getFloat("importe");
                                totcosto+=rs.getFloat("importecosto");
                                //totutili+=rs.getFloat("utilidad");
                                jtable_modelo_resumencostos.addRow(new Object[]{"1:COSTO APARTADOS",miformat.format(rs.getFloat("can")),miformat.format(rs.getFloat("importecosto")),"0","0"});
                         }

                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }
            //abonos y liquidacion de apartados
                  texto="select * from x1venta_deldia_apartados(1,"+idesq+",'"+pFechai+"','"+pFecha+"','') as (fecha date,importe double precision,fechatexto text);";
                  importe1=0;
                    System.out.println(texto);
                            try{
                                  rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                                  while (rs.next())
                                    {
                                        if(rs.getString("importe")!=null)
                                            {
                                                importe1+=rs.getFloat("importe");
                                                importe+=rs.getFloat("importe");
                                            }
                                    }//consulto la bd
                                }
                            catch(Exception e)
                                {
                                    System.out.println(e.getMessage());
                                }
                                jtable_modelo_resumencostos.addRow(new Object[]{"1:PAGO APARTADOS","0","0",miformat.format(importe1),"0"});
                importe1=0;
                texto="select * from x1venta_deldia_cancelaciones_aparta(1,"+idesq+",'"+pFechai+"','"+pFecha+"','') as (fecha date,importe double precision,fechatexto text);";
                    System.out.println(texto);
                            try{
                                  rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                                  while (rs.next())
                                    {
                                        if(rs.getString("importe")!=null)
                                            {
                                                importe1+=rs.getFloat("importe");
                                                importe+=rs.getFloat("importe");
                                            }
                                    }//consulto la bd
                                }
                            catch(Exception e)
                                {
                                    System.out.println(e.getMessage());
                                }
              jtable_modelo_resumencostos.addRow(new Object[]{"1:CANCELACION DE APARTADOS","0","0",miformat.format(importe1),"0"});
              texto="select * from x1ventas_costos(3,'"+idesq+"',"+ordena+",'"+pFechai+"','"+pFecha+"','"+busca6+"','') as (can real,importe double precision,importecosto double precision,utilidad double precision);";
              try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                                totalpiezas+=rs.getFloat("can")*-1;
                                importe+=rs.getFloat("importe")*-1;
                                totcosto+=rs.getFloat("importecosto")*-1;
                                totutili+=rs.getFloat("utilidad")*-1;
                               jtable_modelo_resumencostos.addRow(new Object[]{"1:CANCELACION VENTAS",miformat.format(rs.getFloat("can")*-1),miformat.format(rs.getFloat("importecosto")*-1),miformat.format(rs.getFloat("importe")*-1),miformat.format(rs.getFloat("utilidad")*-1)});
                         }

                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }
               texto="select * from x1ventas_costos(4,'"+idesq+"',"+ordena+",'"+pFechai+"','"+pFecha+"','"+busca6+"','') as (can bigint,importecosto numeric);";
              try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                                totalpiezas+=rs.getFloat("can")*-1;
                                devcan=rs.getFloat("can")*-1;
                                //importe+=rs.getFloat("importe");
                                totcosto+=rs.getFloat("importecosto")*-1;
                                devcos=rs.getFloat("importecosto")*-1;
                                //totutili+=rs.getFloat("utilidad");

                         }

                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }
                    texto="select * from x1venta_deldia_devoluciones(1,"+idesq+",'"+pFechai+"','"+pFecha+"','') as (fecha date,importe double precision,fechatexto text);";
                    System.out.println(texto);
                            try{
                                  rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                                  while (rs.next())
                                    {
                                        if(rs.getString("importe")!=null)
                                            {
                                               importe+=rs.getFloat("importe");
                                               devpre+=rs.getFloat("importe");
                                            }
                                    }//consulto la bd
                                }
                            catch(Exception e)
                                {
                                    System.out.println(e.getMessage());
                                }
                    totutili+=(devpre-devcos);
                    jtable_modelo_resumencostos.addRow(new Object[]{"1:DEVOLUCIONES",miformat.format(devcan),miformat.format(devcos),miformat.format(devpre),miformat.format(devpre-devcos)});
                    jtable_modelo_resumencostos.addRow(new Object[]{"Totales: ",""+miformat.format(totalpiezas)+"",""+miformat.format(totcosto)+"",""+miformat.format(importe)+"",""+miformat.format(totutili)+"",""+miformat.format((totutili/totcosto)*100)+""});



 }

private void contruir_reporte_costosdetalle(Date fechai,Date fecha,int ordena,String idesq,String busca6,String busca7)
    {
        //fecha es la final del reporte
         DefaultCategoryDataset dataset = new DefaultCategoryDataset();//detalle por tienda
         String titulografico="",titulograficoh="",ti="";


        DecimalFormat miformat = new DecimalFormat("###,###,###,###");
        int ii=0,idtienda=0,ndias=0,reg=0,noaten=0;
        //indicamos 7 columnas
        Object valtie = null;


        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");

        String pFechai = formato.format(fechai);//fecha final de reporte
        String pFecha = formato.format(fecha);//fecha final de reporte
        String serie1="",tienda="",texto="select * from x1ventas_costos(1,'"+idesq+"',"+ordena+",'"+pFechai+"','"+pFecha+"','"+busca6+"','') as (can real,importe double precision,importecosto double precision,utilidad double precision);";

        float importe=0,totalpiezas=0,totcosto=0,totutili=0,importe1=0,devcan=0,devcos=0,devpre=0;
        System.out.println(texto);
               try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                                totalpiezas+=rs.getFloat("can");
                                importe+=rs.getFloat("importe");
                                totcosto+=rs.getFloat("importecosto");
                                totutili+=rs.getFloat("utilidad");
                                jtable_modelo_resumencostos.addRow(new Object[]{"1:VENTAS",miformat.format(rs.getFloat("can")),miformat.format(rs.getFloat("importecosto")),miformat.format(rs.getFloat("importe")),miformat.format(rs.getFloat("utilidad"))});
                         }

                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }
                     //costo de apartados
              texto="select * from x1ventas_costos(2,'"+idesq+"',"+ordena+",'"+pFechai+"','"+pFecha+"','"+busca6+"','') as (can bigint,importe double precision,importecosto numeric,utilidad double precision);";
              try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                                totalpiezas+=rs.getFloat("can");
                                //importe+=rs.getFloat("importe");
                                totcosto+=rs.getFloat("importecosto");
                                //totutili+=rs.getFloat("utilidad");
                                jtable_modelo_resumencostos.addRow(new Object[]{"1:COSTO APARTADOS",miformat.format(rs.getFloat("can")),miformat.format(rs.getFloat("importecosto")),"0","0"});
                         }

                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }
            //abonos y liquidacion de apartados
                  texto="select * from x1venta_deldia_apartados(1,"+idesq+",'"+pFechai+"','"+pFecha+"','') as (fecha date,importe double precision,fechatexto text);";
                  importe1=0;
                    System.out.println(texto);
                            try{
                                  rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                                  while (rs.next())
                                    {
                                        if(rs.getString("importe")!=null)
                                            {
                                                importe1+=rs.getFloat("importe");
                                                importe+=rs.getFloat("importe");
                                            }
                                    }//consulto la bd
                                }
                            catch(Exception e)
                                {
                                    System.out.println(e.getMessage());
                                }
                                jtable_modelo_resumencostos.addRow(new Object[]{"1:PAGO APARTADOS","0","0",miformat.format(importe1),"0"});
                importe1=0;
                texto="select * from x1venta_deldia_cancelaciones_aparta(1,"+idesq+",'"+pFechai+"','"+pFecha+"','') as (fecha date,importe double precision,fechatexto text);";
                    System.out.println(texto);
                            try{
                                  rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                                  while (rs.next())
                                    {
                                        if(rs.getString("importe")!=null)
                                            {
                                                importe1+=rs.getFloat("importe");
                                                importe+=rs.getFloat("importe");
                                            }
                                    }//consulto la bd
                                }
                            catch(Exception e)
                                {
                                    System.out.println(e.getMessage());
                                }
              jtable_modelo_resumencostos.addRow(new Object[]{"1:CANCELACION DE APARTADOS","0","0",miformat.format(importe1),"0"});
              texto="select * from x1ventas_costos(3,'"+idesq+"',"+ordena+",'"+pFechai+"','"+pFecha+"','"+busca6+"','') as (can real,importe double precision,importecosto double precision,utilidad double precision);";
              try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                                totalpiezas+=rs.getFloat("can")*-1;
                                importe+=rs.getFloat("importe")*-1;
                                totcosto+=rs.getFloat("importecosto")*-1;
                                totutili+=rs.getFloat("utilidad")*-1;
                               jtable_modelo_resumencostos.addRow(new Object[]{"1:CANCELACION VENTAS",miformat.format(rs.getFloat("can")*-1),miformat.format(rs.getFloat("importecosto")*-1),miformat.format(rs.getFloat("importe")*-1),miformat.format(rs.getFloat("utilidad")*-1)});
                         }

                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }
               texto="select * from x1ventas_costos(4,'"+idesq+"',"+ordena+",'"+pFechai+"','"+pFecha+"','"+busca6+"','') as (can bigint,importecosto numeric);";
              try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                                totalpiezas+=rs.getFloat("can")*-1;
                                devcan=rs.getFloat("can")*-1;
                                //importe+=rs.getFloat("importe");
                                totcosto+=rs.getFloat("importecosto")*-1;
                                devcos=rs.getFloat("importecosto")*-1;
                                //totutili+=rs.getFloat("utilidad");

                         }

                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }
                    texto="select * from x1venta_deldia_devoluciones(1,"+idesq+",'"+pFechai+"','"+pFecha+"','') as (fecha date,importe double precision,fechatexto text);";
                    System.out.println(texto);
                            try{
                                  rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                                  while (rs.next())
                                    {
                                        if(rs.getString("importe")!=null)
                                            {
                                               importe+=rs.getFloat("importe");
                                               devpre+=rs.getFloat("importe");
                                            }
                                    }//consulto la bd
                                }
                            catch(Exception e)
                                {
                                    System.out.println(e.getMessage());
                                }
                    totutili+=(devpre-devcos);
                    jtable_modelo_resumencostos.addRow(new Object[]{"1:DEVOLUCIONES",miformat.format(devcan),miformat.format(devcos),miformat.format(devpre),miformat.format(devpre-devcos)});
                    jtable_modelo_resumencostos.addRow(new Object[]{busca7+"   Totales: ",""+miformat.format(totalpiezas)+"",""+miformat.format(totcosto)+"",""+miformat.format(importe)+"",""+miformat.format(totutili)+"",""+miformat.format((totutili/totcosto)*100)+""});
                    jtable_modelo_resumencostos.addRow(new Object[]{"<html><BODY bgcolor=#CC0066><font color=#CC0066>______________________</font></BODY></html>","<html><BODY bgcolor=#CC0066><font color=#CC0066>______________________</font></BODY></html>","<html><BODY bgcolor=#CC0066><font color=#CC0066>______________________</font></BODY></html>","<html><BODY bgcolor=#CC0066><font color=#CC0066>______________________</font></BODY></html>","<html><BODY bgcolor=#CC0066><font color=#CC0066>______________________</font></BODY></html>","<html><BODY bgcolor=#CC0066><font color=#CC0066>______________________</font></BODY></html>"});

 }
private int findcolumna_idtienda (String titulo)  {
  int columnas = jtable_modelo_detxtie.getColumnCount(),columencontrado=0;
  String columtitulo[]=null;
      for(int j = 0 ;j < columnas ; j++)
                {
                    columtitulo= jtable_modelo_detxtie.getColumnName(j).replace("<html><b>","").split(":");
                     System.out.println("Busqueda:"+columtitulo[0]+" "+titulo);
                    if(columtitulo[0].equals(titulo))
                        {
                            columencontrado=j;
                             System.out.println(titulo+" "+columtitulo[0]+" "+columencontrado);
                        }
                }
    return columencontrado;
}
private int findcolumna_idmes(String titulo)  {
  int columnas = jtable_modelo_compraxfammes.getColumnCount(),columencontrado=0;
  String columtitulo="";
      for(int j = 2 ;j < columnas ; j++)
                {
                    columtitulo= jtable_modelo_compraxfammes.getColumnName(j).replace("<html><b>","");
                     
                    if(columtitulo.equals(titulo))
                        {
                            columencontrado=j;
                             System.out.println(titulo+" "+columtitulo+" "+columencontrado);
                        }
                }
    return columencontrado;
}
private String  fechaeuropea(Date fecha) {
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
       String cadenafecha="";

       cadenafecha= formateadorestaeuropa.format(fecha);
       return cadenafecha;

    }

private void crearcomentario()
          {
                 String retorno="";

        String comentario=JOptionPane.showInputDialog("Ingresa Tu Sugerencia o Comentario:");
        if (comentario.length()>0)
        {
            rs = x.sieuno_executediversosv2("select * from x1distribucion_bitacorainserta('"+comentario+"', 'Art. Mas Vendidos');",variables_global.getconexiongral());
            try
            {

               while (rs.next())
                    {
                         retorno=rs.getString(1);
                   }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
            if (retorno.equals("1"))
              {
                JOptionPane.showMessageDialog(null,"Gracias Tu comentario ha sido guardado", "Sistema Integral Comentarios",1);

              }

      }
    }

  private void jt_repmasvenproveeMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }


private void dioclick(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        System.out.println("dio doble  click");

        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");

        String pFechai = formato.format(this.jdc_fechainicial.getDate());//fecha final de reporte
        String pFecha = formato.format(this.jdc_fechafinal.getDate());//fecha final de reporte

        String arreglo_idtienda[]=this.jcbx_tiendas.getSelectedItem().toString().split(":");

        int fila = jt_repmasvenprovee.getSelectedRow();
        String arregle_idsubfam[] = jt_repmasvenprovee.getValueAt(fila, 8).toString().split(":");

        articulos_sie_rep_masvendidos fasrm=new articulos_sie_rep_masvendidos(1, arreglo_idtienda[0],arregle_idsubfam[0],pFechai,pFecha,"Subfamilia:"+arregle_idsubfam[1]);
        fasrm.pack();
        fasrm.setVisible(true);

        //setVisible(false);
    }
private void dioclicka(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        System.out.println("dio doble  click");

        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");

        String pFechai = formato.format(this.jdc_fechainicial.getDate());//fecha final de reporte
        String pFecha = formato.format(this.jdc_fechafinal.getDate());//fecha final de reporte

        String arreglo_idtienda[]=this.jcbx_tiendas.getSelectedItem().toString().split(":");

        int fila = jt_repmasvenprovee1.getSelectedRow();
        String arregle_idsubfam[] = jt_repmasvenprovee1.getValueAt(fila, 8).toString().split(":");

        articulos_sie_rep_masvendidos fasrm=new articulos_sie_rep_masvendidos(1, arreglo_idtienda[0],arregle_idsubfam[0],pFechai,pFecha,"Subfamilia:"+arregle_idsubfam[1]);
        fasrm.pack();
        fasrm.setVisible(true);

        //setVisible(false);
    }

private void dioclickpro(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
         int fila = jt_repmasvenprovee2.getSelectedRow();
         String valor[] = jtable_modelo_compra.getValueAt(fila, 8).toString().split(":");
        com_distri_compras_proveedores_edita fcdcpe=new com_distri_compras_proveedores_edita(valor[0]);
        fcdcpe.pack();
        fcdcpe.setVisible(true);
        //setVisible(false);
    }
private void find_textoenjtable(int columna,int filainicio,String texto)
    {

       int totalfilasreporte=this.jtable_modelo.getRowCount(),i=0,encontro=0,coincidencias=0;

       String cadenaobtenida="";
         //genero los totales por tienda

       for(i=0;i<totalfilasreporte;i++)
            {
                cadenaobtenida=jtable_modelo.getValueAt(i, columna).toString();
                encontro=cadenaobtenida.indexOf(texto);
                if(encontro!=-1)
                    {
                        System.out.println(cadenaobtenida+" en pocicion "+i);
                        this.jt_repmasvenprovee.changeSelection(i, 0, true, false);
                        encontro=-1;
                        coincidencias++;
                    }
            }
            this.jlb_resultado.setText("Resultado:"+this.jtf_buscarenjtable.getText()+"="+coincidencias);
    }
private void imprimir(int pag,float ptotal,String folio)
    {

     java.util.Date fechahoya=new Date();
    DecimalFormat miformat = new DecimalFormat("###,###,###,###");

     this.objimpresora=new sie_impresiones();
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Id-Rep:V2                                 S.I.: Ventas y Utilidad");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Fecha de Impresion de Reporte:"+this.fechaeuropea(fechahoy)+"  Hora "+fechahoy.getHours()+":"+fechahoy.getMinutes());
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Fecha Inicio:"+this.fechaeuropea(this.jdc_fechainicial.getDate())+"        Fecha Fin:"+this.fechaeuropea(this.jdc_fechafinal.getDate()));
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Tienda:"+this.jtf_tiendavu.getText()+" ");
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");

     if((pag+1)>ptotal)
        {
            this.objimpresora.setOneItem_cadenas_a_imprimir("paginas:"+ pag + " de "+ptotal+"");
           // this.objimpresora.setOneItem_cadenas_a_imprimir("        Venta del dia:$"+this.jtf_totalprecio.getText()+"   Monedero: "+this.jtf_totalmonedero.getText()+ "         Importe Ventas - Monedero:" +miformat.format(Float.valueOf(this.jtf_totalprecio.getText().toString())+Float.valueOf(this.jtf_totalmonedero.getText().toString())));
           // this.objimpresora.setOneItem_cadenas_a_imprimir("        Diferencias por Redondeo:$"+this.jtf_diariodif.getText());
        }
     //this.objimpresora.setOneItem_cadenas_a_imprimir("          Pagina: "+(pag+1)+" de"+ptotal);
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");

     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     this.objimpresora.setObjeto_tabla(jt_repmasvenprovee3);
     this.objimpresora.imprimir_all(14,pag);
    }
private void imprimirc(int pag,float ptotal,String folio)
    {

     java.util.Date fechahoya=new Date();
    DecimalFormat miformat = new DecimalFormat("###,###,###,###");

     this.objimpresora=new sie_impresiones();
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Id-Rep:C5                          S.I.:Compras(Resumen de Compras por Fecha)");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Fecha de Impresion de Reporte:"+this.fechaeuropea(fechahoy)+"  Hora "+fechahoy.getHours()+":"+fechahoy.getMinutes()+" Usuario:"+variables_global.getNombre());
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Fecha Inicio:"+this.jtf_comfi.getText()+"        Fecha Fin:"+this.jtf_comff.getText());
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Tienda:"+this.jtf_comtie.getText()+" ");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Clasificacion de Proveedor:"+this.jtf_comidcla.getText()+" ");
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     if((pag+1)>ptotal)
        {
           // this.objimpresora.setOneItem_cadenas_a_imprimir("        Venta del dia:$"+this.jtf_totalprecio.getText()+"   Monedero: "+this.jtf_totalmonedero.getText()+ "         Importe Ventas - Monedero:" +miformat.format(Float.valueOf(this.jtf_totalprecio.getText().toString())+Float.valueOf(this.jtf_totalmonedero.getText().toString())));
           // this.objimpresora.setOneItem_cadenas_a_imprimir("        Diferencias por Redondeo:$"+this.jtf_diariodif.getText());
              this.objimpresora.setOneItem_cadenas_a_imprimir("paginas:"+ pag + " de "+ptotal+"");
        }
     //this.objimpresora.setOneItem_cadenas_a_imprimir("          Pagina: "+(pag+1)+" de"+ptotal);
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");

     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     this.objimpresora.setObjeto_tabla(jt_repmasvenprovee2);
     this.objimpresora.imprimir_all(15,pag);
    }


    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        jMenuItem4 = new javax.swing.JMenuItem();
        buttonGroup3 = new javax.swing.ButtonGroup();
        jPanel2 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jrbtn_mesactuaante = new javax.swing.JRadioButton();
        jrbtn_incluirtodo = new javax.swing.JRadioButton();
        jrbtn_estemes = new javax.swing.JRadioButton();
        jrbtn_mespasada = new javax.swing.JRadioButton();
        jbtn_generareporte = new javax.swing.JButton();
        jdc_fechafinal = new com.toedter.calendar.JDateChooser();
        jdc_fechainicial = new com.toedter.calendar.JDateChooser();
        jLabel2 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jcbx_tiendas = new javax.swing.JComboBox();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jrbtn_piezas = new javax.swing.JRadioButton();
        jrbtn_importe = new javax.swing.JRadioButton();
        jrbtn_masrentable = new javax.swing.JRadioButton();
        jLabel15 = new javax.swing.JLabel();
        jcbx_clasificacion = new javax.swing.JComboBox();
        jbtn_generareporte1 = new javax.swing.JButton();
        jcbx_detallecostos = new javax.swing.JCheckBox();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jt_repmasvenprovee = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }}
            ;
            jLabel6 = new javax.swing.JLabel();
            jlbl_cantidadregistros = new javax.swing.JLabel();
            jLabel7 = new javax.swing.JLabel();
            jrbtn_generagrafica = new javax.swing.JRadioButton();
            jLabel12 = new javax.swing.JLabel();
            jrtbn_descripcion = new javax.swing.JRadioButton();
            jLabel13 = new javax.swing.JLabel();
            jtf_buscarenjtable = new javax.swing.JTextField();
            jlb_resultado = new javax.swing.JLabel();
            jtf_totalventa = new javax.swing.JTextField();
            jLabel10 = new javax.swing.JLabel();
            jLabel11 = new javax.swing.JLabel();
            jtf_totalapartado = new javax.swing.JTextField();
            jLabel14 = new javax.swing.JLabel();
            jtf_total = new javax.swing.JTextField();
            jPanel1 = new javax.swing.JPanel();
            jScrollPane2 = new javax.swing.JScrollPane();
            jt_repmasvenprovee1 = new javax.swing.JTable(){
                public boolean isCellEditable(int rowIndex, int mColIndex) {
                    return false;
                }}
                ;
                jLabel8 = new javax.swing.JLabel();
                jlbl_cantidadregistros1 = new javax.swing.JLabel();
                jLabel9 = new javax.swing.JLabel();
                jLabel22 = new javax.swing.JLabel();
                jPanel3 = new javax.swing.JPanel();
                jScrollPane3 = new javax.swing.JScrollPane();
                jt_repmasvenprovee2 = new javax.swing.JTable(){
                    public boolean isCellEditable(int rowIndex, int mColIndex) {
                        return false;
                    }}
                    ;
                    jButton2 = new javax.swing.JButton();
                    jtf_comidcla = new javax.swing.JTextField();
                    jtf_comfi = new javax.swing.JTextField();
                    jtf_comff = new javax.swing.JTextField();
                    jtf_comtie = new javax.swing.JTextField();
                    jLabel25 = new javax.swing.JLabel();
                    jLabel26 = new javax.swing.JLabel();
                    jLabel27 = new javax.swing.JLabel();
                    jLabel28 = new javax.swing.JLabel();
                    jLabel29 = new javax.swing.JLabel();
                    jcbx_detallecostos2 = new javax.swing.JCheckBox();
                    jPanel6 = new javax.swing.JPanel();
                    jScrollPane7 = new javax.swing.JScrollPane();
                    jtb_repxfamiliasxtienda = new javax.swing.JTable(){
                        public boolean isCellEditable(int rowIndex, int mColIndex) {
                            return false;
                        }}
                        ;
                        ;
                        jPanel5 = new javax.swing.JPanel();
                        jLabel16 = new javax.swing.JLabel();
                        jLabel17 = new javax.swing.JLabel();
                        jLabel18 = new javax.swing.JLabel();
                        jLabel19 = new javax.swing.JLabel();
                        jLabel20 = new javax.swing.JLabel();
                        jLabel23 = new javax.swing.JLabel();
                        jLabel24 = new javax.swing.JLabel();
                        jPanel7 = new javax.swing.JPanel();
                        jScrollPane4 = new javax.swing.JScrollPane();
                        jt_repmasvenprovee3 = new javax.swing.JTable(){
                            public boolean isCellEditable(int rowIndex, int mColIndex) {
                                return false;
                            }}
                            ;
                            jtf_tiendavu = new javax.swing.JTextField();
                            jLabel21 = new javax.swing.JLabel();
                            jButton1 = new javax.swing.JButton();
                            jPanel8 = new javax.swing.JPanel();
                            jLabel30 = new javax.swing.JLabel();
                            jtf_comidcla1 = new javax.swing.JTextField();
                            jLabel31 = new javax.swing.JLabel();
                            jtf_comfi1 = new javax.swing.JTextField();
                            jtf_comff1 = new javax.swing.JTextField();
                            jLabel32 = new javax.swing.JLabel();
                            jtf_comtie1 = new javax.swing.JTextField();
                            jScrollPane5 = new javax.swing.JScrollPane();
                            jt_repmasvenprovee4 = new javax.swing.JTable(){
                                public boolean isCellEditable(int rowIndex, int mColIndex) {
                                    return false;
                                }}
                                ;
                                jcbx_detallecostos1 = new javax.swing.JCheckBox();
                                jScrollPane6 = new javax.swing.JScrollPane();
                                jt_repmasvenprovee5 = new javax.swing.JTable(){
                                    public boolean isCellEditable(int rowIndex, int mColIndex) {
                                        return false;
                                    }}
                                    ;
                                    jMenuBar1 = new javax.swing.JMenuBar();
                                    jMenu1 = new javax.swing.JMenu();
                                    jMenuItem2 = new javax.swing.JMenuItem();
                                    jmni_generagrafica = new javax.swing.JMenuItem();
                                    jmni_salir = new javax.swing.JMenuItem();
                                    jMenu2 = new javax.swing.JMenu();
                                    jMenuItem1 = new javax.swing.JMenuItem();
                                    jMenuItem3 = new javax.swing.JMenuItem();
                                    jmni_iraordenado = new javax.swing.JMenuItem();
                                    jMenuItem5 = new javax.swing.JMenuItem();
                                    jmni_escape = new javax.swing.JMenuItem();
                                    jmni_irafindtexto = new javax.swing.JMenuItem();
                                    jmni_imprimirtraspa = new javax.swing.JMenuItem();
                                    jMenu3 = new javax.swing.JMenu();
                                    jmni_ayuda = new javax.swing.JMenuItem();
                                    jmni_crearcomentario = new javax.swing.JMenuItem();

                                    jMenuItem4.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_M, java.awt.event.InputEvent.ALT_MASK));
                                    org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(sie_invdis.Sie_invdisApp.class).getContext().getResourceMap(articulos_sie_rep_masvenxp.class);
                                    jMenuItem4.setText(resourceMap.getString("jMenuItem4.text")); // NOI18N
                                    jMenuItem4.setName("jMenuItem4"); // NOI18N

                                    setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
                                    setTitle(resourceMap.getString("Form.title")); // NOI18N
                                    setName("Form"); // NOI18N

                                    jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel2.border.title"))); // NOI18N
                                    jPanel2.setName("jPanel2"); // NOI18N

                                    jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
                                    jLabel3.setName("jLabel3"); // NOI18N

                                    buttonGroup1.add(jrbtn_mesactuaante);
                                    jrbtn_mesactuaante.setText(resourceMap.getString("jrbtn_mesactuaante.text")); // NOI18N
                                    jrbtn_mesactuaante.setToolTipText(resourceMap.getString("jrbtn_mesactuaante.toolTipText")); // NOI18N
                                    jrbtn_mesactuaante.setName("jrbtn_mesactuaante"); // NOI18N
                                    jrbtn_mesactuaante.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jrbtn_mesactuaanteActionPerformed(evt);
                                        }
                                    });

                                    buttonGroup1.add(jrbtn_incluirtodo);
                                    jrbtn_incluirtodo.setText(resourceMap.getString("jrbtn_incluirtodo.text")); // NOI18N
                                    jrbtn_incluirtodo.setToolTipText(resourceMap.getString("jrbtn_incluirtodo.toolTipText")); // NOI18N
                                    jrbtn_incluirtodo.setName("jrbtn_incluirtodo"); // NOI18N
                                    jrbtn_incluirtodo.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jrbtn_incluirtodoActionPerformed(evt);
                                        }
                                    });

                                    buttonGroup1.add(jrbtn_estemes);
                                    jrbtn_estemes.setText(resourceMap.getString("jrbtn_estemes.text")); // NOI18N
                                    jrbtn_estemes.setToolTipText(resourceMap.getString("jrbtn_estemes.toolTipText")); // NOI18N
                                    jrbtn_estemes.setName("jrbtn_estemes"); // NOI18N
                                    jrbtn_estemes.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jrbtn_estemesActionPerformed(evt);
                                        }
                                    });

                                    buttonGroup1.add(jrbtn_mespasada);
                                    jrbtn_mespasada.setText(resourceMap.getString("jrbtn_mespasada.text")); // NOI18N
                                    jrbtn_mespasada.setToolTipText(resourceMap.getString("jrbtn_mespasada.toolTipText")); // NOI18N
                                    jrbtn_mespasada.setName("jrbtn_mespasada"); // NOI18N
                                    jrbtn_mespasada.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jrbtn_mespasadaActionPerformed(evt);
                                        }
                                    });

                                    jbtn_generareporte.setIcon(resourceMap.getIcon("jbtn_generareporte.icon")); // NOI18N
                                    jbtn_generareporte.setText(resourceMap.getString("jbtn_generareporte.text")); // NOI18N
                                    jbtn_generareporte.setToolTipText(resourceMap.getString("jbtn_generareporte.toolTipText")); // NOI18N
                                    jbtn_generareporte.setName("jbtn_generareporte"); // NOI18N
                                    jbtn_generareporte.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jbtn_generareporteActionPerformed(evt);
                                        }
                                    });

                                    jdc_fechafinal.setToolTipText(resourceMap.getString("jdc_fechafinal.toolTipText")); // NOI18N
                                    jdc_fechafinal.setDateFormatString(resourceMap.getString("jdc_fechafinal.dateFormatString")); // NOI18N
                                    jdc_fechafinal.setMaxSelectableDate(new java.util.Date(253370790102000L));
                                    jdc_fechafinal.setName("jdc_fechafinal"); // NOI18N

                                    jdc_fechainicial.setToolTipText(resourceMap.getString("jdc_fechainicial.toolTipText")); // NOI18N
                                    jdc_fechainicial.setDateFormatString(resourceMap.getString("jdc_fechainicial.dateFormatString")); // NOI18N
                                    jdc_fechainicial.setName("jdc_fechainicial"); // NOI18N
                                    jdc_fechainicial.addInputMethodListener(new java.awt.event.InputMethodListener() {
                                        public void caretPositionChanged(java.awt.event.InputMethodEvent evt) {
                                        }
                                        public void inputMethodTextChanged(java.awt.event.InputMethodEvent evt) {
                                            jdc_fechainicialInputMethodTextChanged(evt);
                                        }
                                    });
                                    jdc_fechainicial.addKeyListener(new java.awt.event.KeyAdapter() {
                                        public void keyPressed(java.awt.event.KeyEvent evt) {
                                            jdc_fechainicialKeyPressed(evt);
                                        }
                                    });

                                    jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
                                    jLabel2.setName("jLabel2"); // NOI18N

                                    jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
                                    jLabel1.setName("jLabel1"); // NOI18N

                                    jcbx_tiendas.setToolTipText(resourceMap.getString("jcbx_tiendas.toolTipText")); // NOI18N
                                    jcbx_tiendas.setName("jcbx_tiendas"); // NOI18N
                                    jcbx_tiendas.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jcbx_tiendasActionPerformed(evt);
                                        }
                                    });

                                    jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
                                    jLabel4.setName("jLabel4"); // NOI18N

                                    jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
                                    jLabel5.setName("jLabel5"); // NOI18N

                                    buttonGroup2.add(jrbtn_piezas);
                                    jrbtn_piezas.setText(resourceMap.getString("jrbtn_piezas.text")); // NOI18N
                                    jrbtn_piezas.setActionCommand(resourceMap.getString("jrbtn_piezas.actionCommand")); // NOI18N
                                    jrbtn_piezas.setName("jrbtn_piezas"); // NOI18N
                                    jrbtn_piezas.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jrbtn_piezasActionPerformed(evt);
                                        }
                                    });

                                    buttonGroup2.add(jrbtn_importe);
                                    jrbtn_importe.setText(resourceMap.getString("jrbtn_importe.text")); // NOI18N
                                    jrbtn_importe.setActionCommand(resourceMap.getString("jrbtn_importe.actionCommand")); // NOI18N
                                    jrbtn_importe.setName("jrbtn_importe"); // NOI18N
                                    jrbtn_importe.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jrbtn_importeActionPerformed(evt);
                                        }
                                    });

                                    buttonGroup2.add(jrbtn_masrentable);
                                    jrbtn_masrentable.setText(resourceMap.getString("jrbtn_masrentable.text")); // NOI18N
                                    jrbtn_masrentable.setActionCommand(resourceMap.getString("jrbtn_masrentable.actionCommand")); // NOI18N
                                    jrbtn_masrentable.setName("jrbtn_masrentable"); // NOI18N
                                    jrbtn_masrentable.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jrbtn_masrentableActionPerformed(evt);
                                        }
                                    });

                                    jLabel15.setText(resourceMap.getString("jLabel15.text")); // NOI18N
                                    jLabel15.setName("jLabel15"); // NOI18N

                                    jcbx_clasificacion.setName("jcbx_clasificacion"); // NOI18N

                                    jbtn_generareporte1.setIcon(resourceMap.getIcon("jbtn_generareporte1.icon")); // NOI18N
                                    jbtn_generareporte1.setText(resourceMap.getString("jbtn_generareporte1.text")); // NOI18N
                                    jbtn_generareporte1.setToolTipText(resourceMap.getString("jbtn_generareporte1.toolTipText")); // NOI18N
                                    jbtn_generareporte1.setName("jbtn_generareporte1"); // NOI18N
                                    jbtn_generareporte1.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jbtn_generareporte1ActionPerformed(evt);
                                        }
                                    });

                                    jcbx_detallecostos.setText(resourceMap.getString("jcbx_detallecostos.text")); // NOI18N
                                    jcbx_detallecostos.setName("jcbx_detallecostos"); // NOI18N
                                    jcbx_detallecostos.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jcbx_detallecostosActionPerformed(evt);
                                        }
                                    });

                                    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
                                    jPanel2.setLayout(jPanel2Layout);
                                    jPanel2Layout.setHorizontalGroup(
                                        jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel2Layout.createSequentialGroup()
                                            .addContainerGap()
                                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addGroup(jPanel2Layout.createSequentialGroup()
                                                    .addComponent(jLabel15)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(jcbx_clasificacion, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(jdc_fechainicial, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(jdc_fechafinal, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(jLabel4)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                    .addComponent(jcbx_tiendas, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(jbtn_generareporte, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(jcbx_detallecostos)
                                                    .addGap(7, 7, 7))
                                                .addGroup(jPanel2Layout.createSequentialGroup()
                                                    .addComponent(jLabel5)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(jrbtn_piezas)
                                                    .addGap(16, 16, 16)
                                                    .addComponent(jrbtn_importe, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                    .addComponent(jrbtn_masrentable)
                                                    .addGap(18, 18, 18)
                                                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 20, Short.MAX_VALUE)
                                                    .addComponent(jrbtn_estemes)
                                                    .addGap(18, 18, 18)
                                                    .addComponent(jrbtn_mespasada, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                    .addComponent(jrbtn_mesactuaante)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                    .addComponent(jrbtn_incluirtodo, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGap(37, 37, 37)
                                                    .addComponent(jbtn_generareporte1, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                    );
                                    jPanel2Layout.setVerticalGroup(
                                        jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel2Layout.createSequentialGroup()
                                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jLabel4)
                                                    .addComponent(jcbx_tiendas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jbtn_generareporte)
                                                    .addComponent(jcbx_detallecostos))
                                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jdc_fechainicial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jcbx_clasificacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jLabel15))
                                                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jdc_fechafinal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                .addComponent(jLabel5)
                                                .addComponent(jrbtn_piezas, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jLabel3)
                                                .addComponent(jrbtn_mesactuaante, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jrbtn_mespasada, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jrbtn_estemes, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jrbtn_importe)
                                                .addComponent(jrbtn_masrentable, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jrbtn_incluirtodo, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jbtn_generareporte1)))
                                    );

                                    jTabbedPane1.setName("jTabbedPane1"); // NOI18N
                                    jTabbedPane1.addChangeListener(new javax.swing.event.ChangeListener() {
                                        public void stateChanged(javax.swing.event.ChangeEvent evt) {
                                            jTabbedPane1StateChanged(evt);
                                        }
                                    });

                                    jPanel4.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
                                    jPanel4.setName("jPanel4"); // NOI18N

                                    jScrollPane1.setName("jScrollPane1"); // NOI18N

                                    jt_repmasvenprovee.setModel(this.jtable_modelo);
                                    jt_repmasvenprovee.setName("jt_repmasvenprovee"); // NOI18N
                                    jt_repmasvenprovee.setRowHeight(26);
                                    jt_repmasvenprovee.addMouseListener(new java.awt.event.MouseAdapter() {
                                        public void mouseClicked(java.awt.event.MouseEvent evt) {
                                            jt_repmasvenproveeMouseClicked(evt);
                                            if(evt.getClickCount() >= 2)
                                            {
                                                dioclick(evt);
                                            }
                                        }
                                    });
                                    jScrollPane1.setViewportView(jt_repmasvenprovee);

                                    jLabel6.setFont(resourceMap.getFont("jLabel6.font")); // NOI18N
                                    jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
                                    jLabel6.setName("jLabel6"); // NOI18N

                                    jlbl_cantidadregistros.setFont(resourceMap.getFont("jlbl_cantidadregistros.font")); // NOI18N
                                    jlbl_cantidadregistros.setText(resourceMap.getString("jlbl_cantidadregistros.text")); // NOI18N
                                    jlbl_cantidadregistros.setName("jlbl_cantidadregistros"); // NOI18N

                                    jLabel7.setFont(resourceMap.getFont("jLabel7.font")); // NOI18N
                                    jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
                                    jLabel7.setName("jLabel7"); // NOI18N

                                    jrbtn_generagrafica.setText(resourceMap.getString("jrbtn_generagrafica.text")); // NOI18N
                                    jrbtn_generagrafica.setName("jrbtn_generagrafica"); // NOI18N
                                    jrbtn_generagrafica.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jrbtn_generagraficaActionPerformed(evt);
                                        }
                                    });

                                    jLabel12.setFont(resourceMap.getFont("jLabel12.font")); // NOI18N
                                    jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
                                    jLabel12.setName("jLabel12"); // NOI18N

                                    buttonGroup3.add(jrtbn_descripcion);
                                    jrtbn_descripcion.setText(resourceMap.getString("jrtbn_descripcion.text")); // NOI18N
                                    jrtbn_descripcion.setActionCommand(resourceMap.getString("jrtbn_descripcion.actionCommand")); // NOI18N
                                    jrtbn_descripcion.setName("jrtbn_descripcion"); // NOI18N
                                    jrtbn_descripcion.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jrtbn_descripcionActionPerformed(evt);
                                        }
                                    });

                                    jLabel13.setFont(resourceMap.getFont("jLabel13.font")); // NOI18N
                                    jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N
                                    jLabel13.setName("jLabel13"); // NOI18N

                                    jtf_buscarenjtable.setName("jtf_buscarenjtable"); // NOI18N
                                    jtf_buscarenjtable.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_buscarenjtableActionPerformed(evt);
                                        }
                                    });

                                    jlb_resultado.setFont(resourceMap.getFont("jlb_resultado.font")); // NOI18N
                                    jlb_resultado.setText(resourceMap.getString("jlb_resultado.text")); // NOI18N
                                    jlb_resultado.setName("jlb_resultado"); // NOI18N

                                    jtf_totalventa.setEditable(false);
                                    jtf_totalventa.setFont(resourceMap.getFont("jtf_totalventa.font")); // NOI18N
                                    jtf_totalventa.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                    jtf_totalventa.setText(resourceMap.getString("jtf_totalventa.text")); // NOI18N
                                    jtf_totalventa.setName("jtf_totalventa"); // NOI18N

                                    jLabel10.setFont(resourceMap.getFont("jLabel10.font")); // NOI18N
                                    jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
                                    jLabel10.setName("jLabel10"); // NOI18N

                                    jLabel11.setFont(resourceMap.getFont("jLabel11.font")); // NOI18N
                                    jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
                                    jLabel11.setName("jLabel11"); // NOI18N

                                    jtf_totalapartado.setEditable(false);
                                    jtf_totalapartado.setFont(resourceMap.getFont("jtf_totalapartado.font")); // NOI18N
                                    jtf_totalapartado.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                    jtf_totalapartado.setText(resourceMap.getString("jtf_totalapartado.text")); // NOI18N
                                    jtf_totalapartado.setName("jtf_totalapartado"); // NOI18N

                                    jLabel14.setFont(resourceMap.getFont("jLabel14.font")); // NOI18N
                                    jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N
                                    jLabel14.setName("jLabel14"); // NOI18N

                                    jtf_total.setEditable(false);
                                    jtf_total.setFont(resourceMap.getFont("jtf_total.font")); // NOI18N
                                    jtf_total.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                    jtf_total.setText(resourceMap.getString("jtf_total.text")); // NOI18N
                                    jtf_total.setName("jtf_total"); // NOI18N

                                    javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
                                    jPanel4.setLayout(jPanel4Layout);
                                    jPanel4Layout.setHorizontalGroup(
                                        jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel4Layout.createSequentialGroup()
                                            .addContainerGap()
                                            .addComponent(jrbtn_generagrafica)
                                            .addGap(79, 79, 79)
                                            .addComponent(jLabel12)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jrtbn_descripcion)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jLabel13)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jtf_buscarenjtable, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jlb_resultado, javax.swing.GroupLayout.PREFERRED_SIZE, 284, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addContainerGap(65, Short.MAX_VALUE))
                                        .addGroup(jPanel4Layout.createSequentialGroup()
                                            .addComponent(jLabel7)
                                            .addGap(18, 18, 18)
                                            .addComponent(jlbl_cantidadregistros, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jLabel6)
                                            .addGap(28, 28, 28)
                                            .addComponent(jLabel10)
                                            .addGap(18, 18, 18)
                                            .addComponent(jtf_totalventa, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jLabel11)
                                            .addGap(18, 18, 18)
                                            .addComponent(jtf_totalapartado, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jLabel14)
                                            .addGap(18, 18, 18)
                                            .addComponent(jtf_total, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(220, 220, 220))
                                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1037, Short.MAX_VALUE)
                                    );
                                    jPanel4Layout.setVerticalGroup(
                                        jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel4Layout.createSequentialGroup()
                                            .addContainerGap()
                                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                .addComponent(jLabel6)
                                                .addComponent(jlbl_cantidadregistros)
                                                .addComponent(jLabel7)
                                                .addComponent(jtf_totalventa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jLabel10)
                                                .addComponent(jtf_totalapartado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jLabel11)
                                                .addComponent(jtf_total, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jLabel14))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 421, Short.MAX_VALUE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                .addComponent(jrbtn_generagrafica)
                                                .addComponent(jLabel12)
                                                .addComponent(jrtbn_descripcion, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jLabel13)
                                                .addComponent(jtf_buscarenjtable, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jlb_resultado)))
                                    );

                                    jTabbedPane1.addTab(resourceMap.getString("jPanel4.TabConstraints.tabTitle"), jPanel4); // NOI18N

                                    jPanel1.setName("jPanel1"); // NOI18N

                                    jScrollPane2.setName("jScrollPane2"); // NOI18N

                                    jt_repmasvenprovee1.setModel(this.jtable_modelo_apa);
                                    jt_repmasvenprovee1.setName("jt_repmasvenprovee1"); // NOI18N
                                    jt_repmasvenprovee1.setRowHeight(26);
                                    jt_repmasvenprovee1.addMouseListener(new java.awt.event.MouseAdapter() {
                                        public void mouseClicked(java.awt.event.MouseEvent evt) {
                                            jt_repmasvenprovee1MouseClicked(evt);
                                            if(evt.getClickCount() >= 2)
                                            {
                                                dioclicka(evt);
                                            }
                                        }
                                    });
                                    jScrollPane2.setViewportView(jt_repmasvenprovee1);

                                    jLabel8.setFont(resourceMap.getFont("jLabel8.font")); // NOI18N
                                    jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
                                    jLabel8.setName("jLabel8"); // NOI18N

                                    jlbl_cantidadregistros1.setFont(resourceMap.getFont("jlbl_cantidadregistros1.font")); // NOI18N
                                    jlbl_cantidadregistros1.setText(resourceMap.getString("jlbl_cantidadregistros1.text")); // NOI18N
                                    jlbl_cantidadregistros1.setName("jlbl_cantidadregistros1"); // NOI18N

                                    jLabel9.setFont(resourceMap.getFont("jLabel9.font")); // NOI18N
                                    jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
                                    jLabel9.setName("jLabel9"); // NOI18N

                                    jLabel22.setFont(resourceMap.getFont("jLabel22.font")); // NOI18N
                                    jLabel22.setText(resourceMap.getString("jLabel22.text")); // NOI18N
                                    jLabel22.setName("jLabel22"); // NOI18N

                                    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
                                    jPanel1.setLayout(jPanel1Layout);
                                    jPanel1Layout.setHorizontalGroup(
                                        jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addContainerGap()
                                            .addComponent(jLabel8)
                                            .addGap(18, 18, 18)
                                            .addComponent(jlbl_cantidadregistros1, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jLabel9)
                                            .addContainerGap(851, Short.MAX_VALUE))
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addContainerGap()
                                            .addComponent(jLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, 908, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addContainerGap(121, Short.MAX_VALUE))
                                        .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 1039, Short.MAX_VALUE)
                                    );
                                    jPanel1Layout.setVerticalGroup(
                                        jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                .addComponent(jLabel9)
                                                .addComponent(jlbl_cantidadregistros1)
                                                .addComponent(jLabel8))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 442, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jLabel22)
                                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    );

                                    jTabbedPane1.addTab(resourceMap.getString("jPanel1.TabConstraints.tabTitle"), jPanel1); // NOI18N

                                    jPanel3.setName("jPanel3"); // NOI18N

                                    jScrollPane3.setName("jScrollPane3"); // NOI18N

                                    jt_repmasvenprovee2.setModel(this.jtable_modelo_compra);
                                    jt_repmasvenprovee2.setName("jt_repmasvenprovee2"); // NOI18N
                                    jt_repmasvenprovee2.setRowHeight(26);
                                    jt_repmasvenprovee2.addMouseListener(new java.awt.event.MouseAdapter() {
                                        public void mouseClicked(java.awt.event.MouseEvent evt) {
                                            jt_repmasvenprovee2MouseClicked(evt);
                                            if(evt.getClickCount() >= 2)
                                            {
                                                dioclickpro(evt);
                                            }
                                        }
                                    });
                                    jScrollPane3.setViewportView(jt_repmasvenprovee2);

                                    jButton2.setIcon(resourceMap.getIcon("jButton2.icon")); // NOI18N
                                    jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N
                                    jButton2.setName("jButton2"); // NOI18N
                                    jButton2.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jButton2ActionPerformed(evt);
                                        }
                                    });

                                    jtf_comidcla.setEditable(false);
                                    jtf_comidcla.setFont(resourceMap.getFont("jtf_comidcla.font")); // NOI18N
                                    jtf_comidcla.setName("jtf_comidcla"); // NOI18N

                                    jtf_comfi.setEditable(false);
                                    jtf_comfi.setFont(resourceMap.getFont("jtf_comfi.font")); // NOI18N
                                    jtf_comfi.setName("jtf_comfi"); // NOI18N

                                    jtf_comff.setEditable(false);
                                    jtf_comff.setFont(resourceMap.getFont("jtf_comff.font")); // NOI18N
                                    jtf_comff.setName("jtf_comff"); // NOI18N

                                    jtf_comtie.setEditable(false);
                                    jtf_comtie.setFont(resourceMap.getFont("jtf_comtie.font")); // NOI18N
                                    jtf_comtie.setName("jtf_comtie"); // NOI18N

                                    jLabel25.setText(resourceMap.getString("jLabel25.text")); // NOI18N
                                    jLabel25.setName("jLabel25"); // NOI18N

                                    jLabel26.setText(resourceMap.getString("jLabel26.text")); // NOI18N
                                    jLabel26.setName("jLabel26"); // NOI18N

                                    jLabel27.setText(resourceMap.getString("jLabel27.text")); // NOI18N
                                    jLabel27.setName("jLabel27"); // NOI18N

                                    jLabel28.setFont(resourceMap.getFont("jLabel28.font")); // NOI18N
                                    jLabel28.setText(resourceMap.getString("jLabel28.text")); // NOI18N
                                    jLabel28.setName("jLabel28"); // NOI18N

                                    jLabel29.setFont(resourceMap.getFont("jLabel29.font")); // NOI18N
                                    jLabel29.setText(resourceMap.getString("jLabel29.text")); // NOI18N
                                    jLabel29.setName("jLabel29"); // NOI18N

                                    jcbx_detallecostos2.setText(resourceMap.getString("jcbx_detallecostos2.text")); // NOI18N
                                    jcbx_detallecostos2.setName("jcbx_detallecostos2"); // NOI18N
                                    jcbx_detallecostos2.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jcbx_detallecostos2ActionPerformed(evt);
                                        }
                                    });

                                    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
                                    jPanel3.setLayout(jPanel3Layout);
                                    jPanel3Layout.setHorizontalGroup(
                                        jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel3Layout.createSequentialGroup()
                                            .addContainerGap()
                                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addGroup(jPanel3Layout.createSequentialGroup()
                                                    .addComponent(jLabel27)
                                                    .addGap(45, 45, 45)
                                                    .addComponent(jtf_comidcla, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGap(33, 33, 33)
                                                    .addComponent(jLabel26, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                    .addComponent(jtf_comfi, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGap(44, 44, 44)
                                                    .addComponent(jtf_comff, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGap(28, 28, 28)
                                                    .addComponent(jLabel25)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                    .addComponent(jtf_comtie, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addGroup(jPanel3Layout.createSequentialGroup()
                                                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(jButton2)
                                                        .addComponent(jcbx_detallecostos2))
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(jLabel29)
                                                        .addComponent(jLabel28, javax.swing.GroupLayout.PREFERRED_SIZE, 770, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                            .addContainerGap(20, Short.MAX_VALUE))
                                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel3Layout.createSequentialGroup()
                                                .addGap(1, 1, 1)
                                                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 1037, Short.MAX_VALUE)
                                                .addGap(1, 1, 1)))
                                    );
                                    jPanel3Layout.setVerticalGroup(
                                        jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                                            .addContainerGap()
                                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                .addComponent(jtf_comidcla, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jtf_comfi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jtf_comff, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jtf_comtie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jLabel25)
                                                .addComponent(jLabel26, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jLabel27))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 407, Short.MAX_VALUE)
                                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                .addComponent(jLabel28)
                                                .addComponent(jcbx_detallecostos2))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                .addComponent(jButton2)
                                                .addComponent(jLabel29)))
                                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel3Layout.createSequentialGroup()
                                                .addGap(45, 45, 45)
                                                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 388, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addContainerGap(62, Short.MAX_VALUE)))
                                    );

                                    jTabbedPane1.addTab(resourceMap.getString("jPanel3.TabConstraints.tabTitle"), jPanel3); // NOI18N

                                    jPanel6.setName("jPanel6"); // NOI18N

                                    jScrollPane7.setName("jScrollPane7"); // NOI18N

                                    jtb_repxfamiliasxtienda.setModel(this.jtable_modelo_detxtie);
                                    jtb_repxfamiliasxtienda.setName("jtb_repxfamiliasxtienda"); // NOI18N
                                    jtb_repxfamiliasxtienda.setRowHeight(26);
                                    jScrollPane7.setViewportView(jtb_repxfamiliasxtienda);

                                    javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
                                    jPanel6.setLayout(jPanel6Layout);
                                    jPanel6Layout.setHorizontalGroup(
                                        jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 1039, Short.MAX_VALUE)
                                    );
                                    jPanel6Layout.setVerticalGroup(
                                        jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel6Layout.createSequentialGroup()
                                            .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 233, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addContainerGap(262, Short.MAX_VALUE))
                                    );

                                    jTabbedPane1.addTab(resourceMap.getString("jPanel6.TabConstraints.tabTitle"), jPanel6); // NOI18N

                                    jPanel5.setName("jPanel5"); // NOI18N

                                    jLabel16.setFont(resourceMap.getFont("jLabel16.font")); // NOI18N
                                    jLabel16.setText(resourceMap.getString("jLabel16.text")); // NOI18N
                                    jLabel16.setName("jLabel16"); // NOI18N

                                    jLabel17.setFont(resourceMap.getFont("jLabel17.font")); // NOI18N
                                    jLabel17.setText(resourceMap.getString("jLabel17.text")); // NOI18N
                                    jLabel17.setName("jLabel17"); // NOI18N

                                    jLabel18.setFont(resourceMap.getFont("jLabel18.font")); // NOI18N
                                    jLabel18.setText(resourceMap.getString("jLabel18.text")); // NOI18N
                                    jLabel18.setName("jLabel18"); // NOI18N

                                    jLabel19.setFont(resourceMap.getFont("jLabel19.font")); // NOI18N
                                    jLabel19.setText(resourceMap.getString("jLabel19.text")); // NOI18N
                                    jLabel19.setName("jLabel19"); // NOI18N

                                    jLabel20.setFont(resourceMap.getFont("jLabel20.font")); // NOI18N
                                    jLabel20.setText(resourceMap.getString("jLabel20.text")); // NOI18N
                                    jLabel20.setName("jLabel20"); // NOI18N

                                    jLabel23.setFont(resourceMap.getFont("jLabel23.font")); // NOI18N
                                    jLabel23.setText(resourceMap.getString("jLabel23.text")); // NOI18N
                                    jLabel23.setName("jLabel23"); // NOI18N

                                    jLabel24.setFont(resourceMap.getFont("jLabel24.font")); // NOI18N
                                    jLabel24.setText(resourceMap.getString("jLabel24.text")); // NOI18N
                                    jLabel24.setName("jLabel24"); // NOI18N

                                    javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
                                    jPanel5.setLayout(jPanel5Layout);
                                    jPanel5Layout.setHorizontalGroup(
                                        jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel5Layout.createSequentialGroup()
                                            .addContainerGap()
                                            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 937, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jLabel24)
                                                .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 907, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 981, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jLabel17, javax.swing.GroupLayout.DEFAULT_SIZE, 984, Short.MAX_VALUE)
                                                .addComponent(jLabel19)
                                                .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 1004, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addContainerGap(25, Short.MAX_VALUE))
                                    );
                                    jPanel5Layout.setVerticalGroup(
                                        jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel5Layout.createSequentialGroup()
                                            .addContainerGap()
                                            .addComponent(jLabel16)
                                            .addGap(25, 25, 25)
                                            .addComponent(jLabel17)
                                            .addGap(18, 18, 18)
                                            .addComponent(jLabel18)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jLabel24)
                                            .addGap(12, 12, 12)
                                            .addComponent(jLabel19)
                                            .addGap(13, 13, 13)
                                            .addComponent(jLabel23)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jLabel20)
                                            .addContainerGap(296, Short.MAX_VALUE))
                                    );

                                    jTabbedPane1.addTab(resourceMap.getString("jPanel5.TabConstraints.tabTitle"), jPanel5); // NOI18N

                                    jPanel7.setName("jPanel7"); // NOI18N

                                    jScrollPane4.setName("jScrollPane4"); // NOI18N

                                    jt_repmasvenprovee3.setModel(this.jtable_modelo_resumencostos);
                                    jt_repmasvenprovee3.setName("jt_repmasvenprovee3"); // NOI18N
                                    jt_repmasvenprovee3.setRowHeight(26);
                                    jt_repmasvenprovee1.addMouseListener(new java.awt.event.MouseAdapter() {
                                        public void mouseClicked(java.awt.event.MouseEvent evt) {
                                            jt_repmasvenprovee1MouseClicked(evt);
                                            if(evt.getClickCount() >= 2)
                                            {
                                                dioclicka(evt);
                                            }
                                        }
                                    });
                                    jScrollPane4.setViewportView(jt_repmasvenprovee3);

                                    jtf_tiendavu.setEditable(false);
                                    jtf_tiendavu.setFont(resourceMap.getFont("jtf_tiendavu.font")); // NOI18N
                                    jtf_tiendavu.setText(resourceMap.getString("jtf_tiendavu.text")); // NOI18N
                                    jtf_tiendavu.setName("jtf_tiendavu"); // NOI18N

                                    jLabel21.setFont(resourceMap.getFont("jLabel21.font")); // NOI18N
                                    jLabel21.setText(resourceMap.getString("jLabel21.text")); // NOI18N
                                    jLabel21.setName("jLabel21"); // NOI18N

                                    jButton1.setIcon(resourceMap.getIcon("jButton1.icon")); // NOI18N
                                    jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
                                    jButton1.setName("jButton1"); // NOI18N
                                    jButton1.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jButton1ActionPerformed(evt);
                                        }
                                    });

                                    javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
                                    jPanel7.setLayout(jPanel7Layout);
                                    jPanel7Layout.setHorizontalGroup(
                                        jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel7Layout.createSequentialGroup()
                                            .addContainerGap()
                                            .addComponent(jLabel21)
                                            .addGap(49, 49, 49)
                                            .addComponent(jtf_tiendavu, javax.swing.GroupLayout.PREFERRED_SIZE, 276, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addContainerGap(663, Short.MAX_VALUE))
                                        .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 1039, Short.MAX_VALUE)
                                        .addGroup(jPanel7Layout.createSequentialGroup()
                                            .addContainerGap()
                                            .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addContainerGap(929, Short.MAX_VALUE))
                                    );
                                    jPanel7Layout.setVerticalGroup(
                                        jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                .addComponent(jtf_tiendavu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jLabel21))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jButton1)
                                            .addGap(16, 16, 16))
                                    );

                                    jTabbedPane1.addTab(resourceMap.getString("jPanel7.TabConstraints.tabTitle"), jPanel7); // NOI18N

                                    jPanel8.setName("jPanel8"); // NOI18N

                                    jLabel30.setText(resourceMap.getString("jLabel30.text")); // NOI18N
                                    jLabel30.setName("jLabel30"); // NOI18N

                                    jtf_comidcla1.setEditable(false);
                                    jtf_comidcla1.setFont(resourceMap.getFont("jtf_comidcla1.font")); // NOI18N
                                    jtf_comidcla1.setName("jtf_comidcla1"); // NOI18N

                                    jLabel31.setText(resourceMap.getString("jLabel31.text")); // NOI18N
                                    jLabel31.setName("jLabel31"); // NOI18N

                                    jtf_comfi1.setEditable(false);
                                    jtf_comfi1.setFont(resourceMap.getFont("jtf_comfi1.font")); // NOI18N
                                    jtf_comfi1.setName("jtf_comfi1"); // NOI18N

                                    jtf_comff1.setEditable(false);
                                    jtf_comff1.setFont(resourceMap.getFont("jtf_comff1.font")); // NOI18N
                                    jtf_comff1.setName("jtf_comff1"); // NOI18N

                                    jLabel32.setText(resourceMap.getString("jLabel32.text")); // NOI18N
                                    jLabel32.setName("jLabel32"); // NOI18N

                                    jtf_comtie1.setEditable(false);
                                    jtf_comtie1.setFont(resourceMap.getFont("jtf_comtie1.font")); // NOI18N
                                    jtf_comtie1.setName("jtf_comtie1"); // NOI18N

                                    jScrollPane5.setName("jScrollPane5"); // NOI18N

                                    jt_repmasvenprovee4.setModel(this.jtable_modelo_compraxfam);
                                    jt_repmasvenprovee4.setName("jt_repmasvenprovee4"); // NOI18N
                                    jt_repmasvenprovee4.setRowHeight(26);
                                    jt_repmasvenprovee2.addMouseListener(new java.awt.event.MouseAdapter() {
                                        public void mouseClicked(java.awt.event.MouseEvent evt) {
                                            jt_repmasvenprovee2MouseClicked(evt);
                                            if(evt.getClickCount() >= 2)
                                            {
                                                dioclickpro(evt);
                                            }
                                        }
                                    });
                                    jScrollPane5.setViewportView(jt_repmasvenprovee4);

                                    jcbx_detallecostos1.setText(resourceMap.getString("jcbx_detallecostos1.text")); // NOI18N
                                    jcbx_detallecostos1.setName("jcbx_detallecostos1"); // NOI18N
                                    jcbx_detallecostos1.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jcbx_detallecostos1ActionPerformed(evt);
                                        }
                                    });

                                    jScrollPane6.setName("jScrollPane6"); // NOI18N

                                    jt_repmasvenprovee5.setModel(this.jtable_modelo_compraxfammes);
                                    jt_repmasvenprovee5.setName("jt_repmasvenprovee5"); // NOI18N
                                    jt_repmasvenprovee5.setRowHeight(26);
                                    jt_repmasvenprovee2.addMouseListener(new java.awt.event.MouseAdapter() {
                                        public void mouseClicked(java.awt.event.MouseEvent evt) {
                                            jt_repmasvenprovee2MouseClicked(evt);
                                            if(evt.getClickCount() >= 2)
                                            {
                                                dioclickpro(evt);
                                            }
                                        }
                                    });
                                    jScrollPane6.setViewportView(jt_repmasvenprovee5);

                                    javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
                                    jPanel8.setLayout(jPanel8Layout);
                                    jPanel8Layout.setHorizontalGroup(
                                        jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel8Layout.createSequentialGroup()
                                            .addContainerGap()
                                            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(jScrollPane5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 1019, Short.MAX_VALUE)
                                                .addComponent(jcbx_detallecostos1)
                                                .addGroup(jPanel8Layout.createSequentialGroup()
                                                    .addComponent(jLabel30)
                                                    .addGap(45, 45, 45)
                                                    .addComponent(jtf_comidcla1, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGap(33, 33, 33)
                                                    .addComponent(jLabel31, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                    .addComponent(jtf_comfi1, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGap(44, 44, 44)
                                                    .addComponent(jtf_comff1, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGap(28, 28, 28)
                                                    .addComponent(jLabel32)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                    .addComponent(jtf_comtie1, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 1019, Short.MAX_VALUE))
                                            .addContainerGap())
                                    );
                                    jPanel8Layout.setVerticalGroup(
                                        jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel8Layout.createSequentialGroup()
                                            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                .addComponent(jtf_comidcla1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jtf_comfi1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jtf_comff1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jtf_comtie1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jLabel32)
                                                .addComponent(jLabel31, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jLabel30))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 199, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 20, Short.MAX_VALUE)
                                            .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 199, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jcbx_detallecostos1)
                                            .addGap(24, 24, 24))
                                    );

                                    jTabbedPane1.addTab(resourceMap.getString("jPanel8.TabConstraints.tabTitle"), jPanel8); // NOI18N

                                    jMenuBar1.setName("jMenuBar1"); // NOI18N

                                    jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
                                    jMenu1.setName("jMenu1"); // NOI18N

                                    jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G, java.awt.event.InputEvent.ALT_MASK));
                                    jMenuItem2.setText(resourceMap.getString("jMenuItem2.text")); // NOI18N
                                    jMenuItem2.setName("jMenuItem2"); // NOI18N
                                    jMenu1.add(jMenuItem2);

                                    jmni_generagrafica.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.ALT_MASK));
                                    jmni_generagrafica.setText(resourceMap.getString("jmni_generagrafica.text")); // NOI18N
                                    jmni_generagrafica.setName("jmni_generagrafica"); // NOI18N
                                    jmni_generagrafica.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jmni_generagraficaActionPerformed(evt);
                                        }
                                    });
                                    jMenu1.add(jmni_generagrafica);

                                    jmni_salir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK));
                                    jmni_salir.setIcon(resourceMap.getIcon("jmni_salir.icon")); // NOI18N
                                    jmni_salir.setText(resourceMap.getString("jmni_salir.text")); // NOI18N
                                    jmni_salir.setName("jmni_salir"); // NOI18N
                                    jmni_salir.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jmni_salirActionPerformed(evt);
                                        }
                                    });
                                    jMenu1.add(jmni_salir);

                                    jMenuBar1.add(jMenu1);

                                    jMenu2.setText(resourceMap.getString("jMenu2.text")); // NOI18N
                                    jMenu2.setName("jMenu2"); // NOI18N

                                    jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.event.InputEvent.ALT_MASK));
                                    jMenuItem1.setText(resourceMap.getString("jMenuItem1.text")); // NOI18N
                                    jMenuItem1.setName("jMenuItem1"); // NOI18N
                                    jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jMenuItem1ActionPerformed(evt);
                                        }
                                    });
                                    jMenu2.add(jMenuItem1);

                                    jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.ALT_MASK));
                                    jMenuItem3.setText(resourceMap.getString("jMenuItem3.text")); // NOI18N
                                    jMenuItem3.setName("jMenuItem3"); // NOI18N
                                    jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jMenuItem3ActionPerformed(evt);
                                        }
                                    });
                                    jMenu2.add(jMenuItem3);

                                    jmni_iraordenado.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.ALT_MASK));
                                    jmni_iraordenado.setText(resourceMap.getString("jmni_iraordenado.text")); // NOI18N
                                    jmni_iraordenado.setName("jmni_iraordenado"); // NOI18N
                                    jMenu2.add(jmni_iraordenado);

                                    jMenuItem5.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_M, java.awt.event.InputEvent.ALT_MASK));
                                    jMenuItem5.setText(resourceMap.getString("jMenuItem4.text")); // NOI18N
                                    jMenuItem5.setName("jMenuItem4"); // NOI18N
                                    jMenu2.add(jMenuItem5);

                                    jmni_escape.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0));
                                    jmni_escape.setText(resourceMap.getString("jmni_escape.text")); // NOI18N
                                    jmni_escape.setName("jmni_escape"); // NOI18N
                                    jmni_escape.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jmni_escapeActionPerformed(evt);
                                        }
                                    });
                                    jMenu2.add(jmni_escape);

                                    jmni_irafindtexto.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.CTRL_MASK));
                                    jmni_irafindtexto.setText(resourceMap.getString("jmni_irafindtexto.text")); // NOI18N
                                    jmni_irafindtexto.setName("jmni_irafindtexto"); // NOI18N
                                    jmni_irafindtexto.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jmni_irafindtextoActionPerformed(evt);
                                        }
                                    });
                                    jMenu2.add(jmni_irafindtexto);

                                    jmni_imprimirtraspa.setText(resourceMap.getString("jmni_imprimirtraspa.text")); // NOI18N
                                    jmni_imprimirtraspa.setName("jmni_imprimirtraspa"); // NOI18N
                                    jmni_imprimirtraspa.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jmni_imprimirtraspaActionPerformed(evt);
                                        }
                                    });
                                    jMenu2.add(jmni_imprimirtraspa);

                                    jMenuBar1.add(jMenu2);

                                    jMenu3.setText(resourceMap.getString("jMenu3.text")); // NOI18N
                                    jMenu3.setName("jMenu3"); // NOI18N
                                    jMenu3.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jMenu3ActionPerformed(evt);
                                        }
                                    });

                                    jmni_ayuda.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.ALT_MASK));
                                    jmni_ayuda.setIcon(resourceMap.getIcon("jmni_ayuda.icon")); // NOI18N
                                    jmni_ayuda.setText(resourceMap.getString("jmni_ayuda.text")); // NOI18N
                                    jmni_ayuda.setName("jmni_ayuda"); // NOI18N
                                    jmni_ayuda.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jmni_ayudaActionPerformed(evt);
                                        }
                                    });
                                    jMenu3.add(jmni_ayuda);

                                    jmni_crearcomentario.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.ALT_MASK));
                                    jmni_crearcomentario.setText(resourceMap.getString("jmni_crearcomentario.text")); // NOI18N
                                    jmni_crearcomentario.setName("jmni_crearcomentario"); // NOI18N
                                    jMenu3.add(jmni_crearcomentario);

                                    jMenuBar1.add(jMenu3);

                                    setJMenuBar(jMenuBar1);

                                    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
                                    getContentPane().setLayout(layout);
                                    layout.setHorizontalGroup(
                                        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jTabbedPane1, 0, 0, Short.MAX_VALUE)
                                    );
                                    layout.setVerticalGroup(
                                        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(layout.createSequentialGroup()
                                            .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 523, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    );

                                    pack();
                                }// </editor-fold>//GEN-END:initComponents

    private void jrbtn_mesactuaanteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_mesactuaanteActionPerformed
        // TODO add your handling code here:
        Calendar fechamesini = Calendar.getInstance(); // obtiene la fecha actual
        this.jdc_fechafinal.setDate(fechamesini.getTime());
        //establesemos la fecha en base a la de hoy menos 1 mes en el dia 1
        fechamesini.set(fechahoy.getYear()+1900,fechahoy.getMonth()-1, 1);
        this.jdc_fechainicial.setDate(fechamesini.getTime());

        
}//GEN-LAST:event_jrbtn_mesactuaanteActionPerformed

    private void jrbtn_incluirtodoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_incluirtodoActionPerformed
        // TODO add your handling code here:
        Calendar fechainisem = Calendar.getInstance(); // obtiene la fecha actual
        
        
        fechainisem.set(2010,4,1); // incrementa en 30 días la fecha actual.
        this.jdc_fechainicial.setDate(fechainisem.getTime());
        
        this.jdc_fechafinal.setDate(fechahoy);
}//GEN-LAST:event_jrbtn_incluirtodoActionPerformed

    private void jrbtn_estemesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_estemesActionPerformed
        // TODO add your handling code here:
        Calendar fechaini = Calendar.getInstance(); // obtiene la fecha actual
        fechaini.set(fechahoy.getYear()+1900,fechahoy.getMonth(), 1);
        this.jdc_fechainicial.setDate(fechaini.getTime());
        this.jdc_fechafinal.setDate(fechahoy);
}//GEN-LAST:event_jrbtn_estemesActionPerformed

    private void jrbtn_mespasadaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_mespasadaActionPerformed
        // TODO add your handling code here:
        Calendar fechamesini = Calendar.getInstance(); // obtiene la fecha actual
        //establesemos la fecha en base a la de hoy menos 1 mes en el dia 1
        fechamesini.set(fechahoy.getYear()+1900,fechahoy.getMonth()-1, 1);
        this.jdc_fechainicial.setDate(fechamesini.getTime());
        //vemos cual fue el ultimo dia del mes anterior restando los dias del mes actual
        fechamesini = Calendar.getInstance(); // obtiene la fecha actual
        int diadelmesactua=fechamesini.get(Calendar.DAY_OF_MONTH);
        fechamesini.add(Calendar.DATE, -diadelmesactua); // se resta el numero de dias del mes
        this.jdc_fechafinal.setDate(fechamesini.getTime());
}//GEN-LAST:event_jrbtn_mespasadaActionPerformed

    private void jbtn_generareporteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_generareporteActionPerformed
        // TODO add your handling code here:
       String arreglo_idtienda[]=this.jcbx_tiendas.getSelectedItem().toString().split(":");
     if(JOptionPane.showConfirmDialog(null, "Estan Correctos sus Datos?")==0)
        {
                String arreglo_cla[]=this.jcbx_clasificacion.getSelectedItem().toString().split(":");
                this.jtf_comidcla.setText(arreglo_cla[1]);
                this.jtf_comfi.setText(this.fechaeuropea(this.jdc_fechainicial.getDate()));
                this.jtf_comff.setText(this.fechaeuropea(this.jdc_fechafinal.getDate()));
                this.jtf_comtie.setText(arreglo_idtienda[1]);

                this.contruir_reporte(this.jdc_fechainicial.getDate(),this.jdc_fechafinal.getDate(),ordenamiento,arreglo_idtienda[0],arreglo_cla[0],"");
                this.contruir_reporte_apa(this.jdc_fechainicial.getDate(),this.jdc_fechafinal.getDate(),ordenamiento,arreglo_idtienda[0]);
                

                if(indice==2)
                {
                    if(this.jcbx_detallecostos.isSelected()==true)
                        {
                            while(jtable_modelo_compra.getRowCount()>0)jtable_modelo_compra.removeRow(0);
                            this.jtf_tiendavu.setText("0:General Detalle");
                            for(int ii=0;ii<this.jtable_tiendas.getRowCount();ii++)
                                {

                                    this.contruir_reporte_compra(this.jdc_fechainicial.getDate(),this.jdc_fechafinal.getDate(),ordenamiento,jtable_tiendas.getValueAt(ii, 1).toString(),arreglo_cla[0],jtable_tiendas.getValueAt(ii, 0).toString());
                                 }
                        }
                    else
                        {
                            while(jtable_modelo_compra.getRowCount()>0)jtable_modelo_compra.removeRow(0);
                            this.contruir_reporte_compra(this.jdc_fechainicial.getDate(),this.jdc_fechafinal.getDate(),ordenamiento,arreglo_idtienda[0],arreglo_cla[0],"");
                        }
                }
              if(indice==3)
                {
                    i3=1;
                    this.contruir_totaleslimpios();
                    this.contruir_reporte_trapasos(this.jdc_fechainicial.getDate(),this.jdc_fechafinal.getDate(),2);
                }
            if(indice==5)
                {
                if(this.jcbx_detallecostos.isSelected()==true)
                        {
                            while(jtable_modelo_resumencostos.getRowCount()>0)jtable_modelo_resumencostos.removeRow(0);
                            this.jtf_tiendavu.setText("0:General Detalle");
                            for(int ii=0;ii<this.jtable_tiendas.getRowCount();ii++)
                                {
                                    this.contruir_reporte_costosdetalle(this.jdc_fechainicial.getDate(),this.jdc_fechafinal.getDate(),ordenamiento,jtable_tiendas.getValueAt(ii, 1).toString(),"0",jtable_tiendas.getValueAt(ii, 0).toString());
                                 }
                        }
                     else
                        {
                            this.jtf_tiendavu.setText(this.jcbx_tiendas.getSelectedItem().toString());
                            this.contruir_reporte_costos(this.jdc_fechainicial.getDate(),this.jdc_fechafinal.getDate(),ordenamiento,arreglo_idtienda[0],arreglo_cla[0],"");
                        }

                }
                if(indice==6)
                {
                if(this.jcbx_detallecostos.isSelected()==true)
                        {
                            while(jtable_modelo_compraxfam.getRowCount()>0)jtable_modelo_compraxfam.removeRow(0);
                           this.jtf_tiendavu.setText("0:General Detalle");
                            for(int ii=0;ii<this.jtable_tiendas.getRowCount();ii++)
                                {

                                    this.contruir_reporte_compraxfam(this.jdc_fechainicial.getDate(),this.jdc_fechafinal.getDate(),ordenamiento,jtable_tiendas.getValueAt(ii, 1).toString(),arreglo_cla[0],jtable_tiendas.getValueAt(ii, 0).toString());
                                 }
                        }
                     else
                        {
                            this.jtf_tiendavu.setText(this.jcbx_tiendas.getSelectedItem().toString());
                            //this.contruir_reporte_costos(this.jdc_fechainicial.getDate(),this.jdc_fechafinal.getDate(),ordenamiento,arreglo_idtienda[0],arreglo_cla[0],"");
                            while(jtable_modelo_compraxfam.getRowCount()>0)jtable_modelo_compraxfam.removeRow(0);
                            while(jtable_modelo_compraxfammes.getRowCount()>0)jtable_modelo_compraxfammes.removeRow(0);
                            this.contruir_reporte_compraxfam(this.jdc_fechainicial.getDate(),this.jdc_fechafinal.getDate(),ordenamiento,arreglo_idtienda[0],arreglo_cla[0],"GENERAL");
                            this.contruir_reporte_compraxfamxmes(this.jdc_fechainicial.getDate(),this.jdc_fechafinal.getDate(),ordenamiento,arreglo_idtienda[0],arreglo_cla[0],"GENERAL");
                        }

                }
        this.centrar_datos();
        }
         
         

        
}//GEN-LAST:event_jbtn_generareporteActionPerformed
private void loadcombo(){
        jtable_tiendas=variables_global.gettabla_tiendas();
         this.jcbx_tiendas.addItem("0:Todas Las Tiendas");
         for(int ii=0;ii<this.jtable_tiendas.getRowCount();ii++)
                {
                    this.jcbx_tiendas.addItem(jtable_tiendas.getValueAt(ii, 1).toString()+":"+jtable_tiendas.getValueAt(ii, 0).toString());
                }
    }

    private void jdc_fechainicialKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jdc_fechainicialKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_jdc_fechainicialKeyPressed

    private void jcbx_tiendasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_tiendasActionPerformed
        // TODO add your handling code here:
        int indeceta=this.jcbx_tiendas.getSelectedIndex();
        
        if (controlcombo > 0 )
                {
                    String arreglo_idtie[]=this.jcbx_tiendas.getSelectedItem().toString().split(":");
                    esquesele=arreglo_idtie[0];
                    this.jbtn_generareporteActionPerformed(evt);
                }


        //this.jtfpruebados.setText(jtable_tiendas.getValueAt(indeceta, 0).toString());
}//GEN-LAST:event_jcbx_tiendasActionPerformed

    private void jrbtn_generagraficaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_generagraficaActionPerformed
        // TODO add your handling code here:
        System.out.println("se crea nuevo:");
        ventas_sie_cortes_graficacion demo1amv = new ventas_sie_cortes_graficacion("Sistema Integral: Cortes del dia Grafico",5);
        demo1amv.pack();
        RefineryUtilities.centerFrameOnScreen(demo1amv);
        demo1amv.setVisible(true);
}//GEN-LAST:event_jrbtn_generagraficaActionPerformed

    private void jrbtn_piezasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_piezasActionPerformed
        // TODO add your handling code here:
         ordenamiento=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_piezasActionPerformed

    private void jrbtn_importeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_importeActionPerformed
        // TODO add your handling code here:
        ordenamiento=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_importeActionPerformed

    private void jrbtn_masrentableActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_masrentableActionPerformed
        // TODO add your handling code here:
        ordenamiento=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_masrentableActionPerformed

    private void jmni_ayudaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_ayudaActionPerformed
        // TODO add your handling code here:
         this.ayuda();
        
}//GEN-LAST:event_jmni_ayudaActionPerformed

    private void jmni_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_salirActionPerformed
        // TODO add your handling code here:
          if(JOptionPane.showConfirmDialog(null, "Realmente Desea Salir?")==0)
                {
                    this.dispose();
                }
        
    }//GEN-LAST:event_jmni_salirActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        // TODO add your handling code here:
        this.jcbx_tiendas.requestFocus();
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jmni_generagraficaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_generagraficaActionPerformed
        // TODO add your handling code here:
        this.jrbtn_generagraficaActionPerformed(evt);
    }//GEN-LAST:event_jmni_generagraficaActionPerformed

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
        // TODO add your handling code here:
        this.jdc_fechainicial.requestFocus();
    }//GEN-LAST:event_jMenuItem3ActionPerformed

    private void jdc_fechainicialInputMethodTextChanged(java.awt.event.InputMethodEvent evt) {//GEN-FIRST:event_jdc_fechainicialInputMethodTextChanged
        // TODO add your handling code here:
       
    }//GEN-LAST:event_jdc_fechainicialInputMethodTextChanged

    private void jMenu3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu3ActionPerformed
        // TODO add your handling code here:
        this.crearcomentario();
    }//GEN-LAST:event_jMenu3ActionPerformed

    private void jmni_escapeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_escapeActionPerformed
        // TODO add your handling code here:
        this.jmni_salirActionPerformed(evt);
    }//GEN-LAST:event_jmni_escapeActionPerformed

    private void jrtbn_descripcionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrtbn_descripcionActionPerformed
        // TODO add your handling code here:
        columnavisualisa=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrtbn_descripcionActionPerformed

    private void jtf_buscarenjtableActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_buscarenjtableActionPerformed
        // TODO add your handling code here:
        this.find_textoenjtable(columnavisualisa, 0, this.jtf_buscarenjtable.getText().toUpperCase().trim());
}//GEN-LAST:event_jtf_buscarenjtableActionPerformed

    private void jmni_irafindtextoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_irafindtextoActionPerformed
        // TODO add your handling code here:
        this.jtf_buscarenjtable.requestFocus();
    }//GEN-LAST:event_jmni_irafindtextoActionPerformed

    private void jTabbedPane1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPane1StateChanged
        // TODO add your handling code here:
         indice=this.jTabbedPane1.getSelectedIndex();
                if((indice==3)&&(i3==0))
                {
                    i3=1;
                    this.contruir_totaleslimpios();
                    this.contruir_reporte_trapasos(this.jdc_fechainicial.getDate(),this.jdc_fechafinal.getDate(),2);
                }

    }//GEN-LAST:event_jTabbedPane1StateChanged

    private void jmni_imprimirtraspaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_imprimirtraspaActionPerformed
        try {
            // TODO add your handling code here:
            this.jtb_repxfamiliasxtienda.print();
        } catch (PrinterException ex) {
            Logger.getLogger(articulos_sie_rep_masvenxp.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jmni_imprimirtraspaActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        this.imprimir(0, 0, "0");
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
        float filas = this.jtable_modelo_compra.getRowCount() ;
        float paginas = filas /50;
        int ni=0;
        for(ni=0;ni<paginas;ni++)
             {

                 this.imprimirc(ni, paginas, "0");
             }
        
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jbtn_generareporte1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_generareporte1ActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Desea Ver Estadistica con Fecha inicio:"+this.fechaeuropea(this.jdc_fechainicial.getDate())+" A Fecha:"+this.fechaeuropea(this.jdc_fechafinal.getDate()))==0)
            {
                    ventas_sie_promociones fvsp=new ventas_sie_promociones(1,this.fechaeuropea(this.jdc_fechainicial.getDate()),this.fechaeuropea(this.jdc_fechafinal.getDate()),"0","0","0");
                    fvsp.pack();
                    fvsp.setVisible(true);
            }
    }//GEN-LAST:event_jbtn_generareporte1ActionPerformed

    private void jcbx_detallecostosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_detallecostosActionPerformed
        // TODO add your handling code here:
        while(jtable_modelo_resumencostos.getRowCount()>0)jtable_modelo_resumencostos.removeRow(0);
       
}//GEN-LAST:event_jcbx_detallecostosActionPerformed

    private void jcbx_detallecostos1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_detallecostos1ActionPerformed
        // TODO add your handling code here:
         if(JOptionPane.showConfirmDialog(null, "Deseas ver todos los clientes que se incluyeron en la distribucion?")==0)
                {
                    while(jtable_modelo_compraxfam.getRowCount()>0)jtable_modelo_compraxfam.removeRow(0);
                    this.contruir_reporte_compraxfamtodosclientes(this.jdc_fechainicial.getDate(),this.jdc_fechafinal.getDate(),ordenamiento,"0","0","GENERAL");
                }

    }//GEN-LAST:event_jcbx_detallecostos1ActionPerformed

    private void jcbx_detallecostos2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_detallecostos2ActionPerformed
        // TODO add your handling code here:
         if(JOptionPane.showConfirmDialog(null, "Deseas ver todos los clientes que se incluyeron en la distribucion?")==0)
            {
                while(jtable_modelo_compra.getRowCount()>0)jtable_modelo_compra.removeRow(0);
                this.contruir_reporte_compracompleta(this.jdc_fechainicial.getDate(),this.jdc_fechafinal.getDate(),ordenamiento,"0","0","0");
            }
    }//GEN-LAST:event_jcbx_detallecostos2ActionPerformed
  private void jt_repmasvenprovee1MouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    private void jt_repmasvenprovee2MouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new articulos_sie_rep_masvenxp().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.ButtonGroup buttonGroup3;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JButton jbtn_generareporte;
    private javax.swing.JButton jbtn_generareporte1;
    private javax.swing.JComboBox jcbx_clasificacion;
    private javax.swing.JCheckBox jcbx_detallecostos;
    private javax.swing.JCheckBox jcbx_detallecostos1;
    private javax.swing.JCheckBox jcbx_detallecostos2;
    private javax.swing.JComboBox jcbx_tiendas;
    private com.toedter.calendar.JDateChooser jdc_fechafinal;
    private com.toedter.calendar.JDateChooser jdc_fechainicial;
    private javax.swing.JLabel jlb_resultado;
    private javax.swing.JLabel jlbl_cantidadregistros;
    private javax.swing.JLabel jlbl_cantidadregistros1;
    private javax.swing.JMenuItem jmni_ayuda;
    private javax.swing.JMenuItem jmni_crearcomentario;
    private javax.swing.JMenuItem jmni_escape;
    private javax.swing.JMenuItem jmni_generagrafica;
    private javax.swing.JMenuItem jmni_imprimirtraspa;
    private javax.swing.JMenuItem jmni_irafindtexto;
    private javax.swing.JMenuItem jmni_iraordenado;
    private javax.swing.JMenuItem jmni_salir;
    private javax.swing.JRadioButton jrbtn_estemes;
    private javax.swing.JRadioButton jrbtn_generagrafica;
    private javax.swing.JRadioButton jrbtn_importe;
    private javax.swing.JRadioButton jrbtn_incluirtodo;
    private javax.swing.JRadioButton jrbtn_masrentable;
    private javax.swing.JRadioButton jrbtn_mesactuaante;
    private javax.swing.JRadioButton jrbtn_mespasada;
    private javax.swing.JRadioButton jrbtn_piezas;
    private javax.swing.JRadioButton jrtbn_descripcion;
    private javax.swing.JTable jt_repmasvenprovee;
    private javax.swing.JTable jt_repmasvenprovee1;
    private javax.swing.JTable jt_repmasvenprovee2;
    private javax.swing.JTable jt_repmasvenprovee3;
    private javax.swing.JTable jt_repmasvenprovee4;
    private javax.swing.JTable jt_repmasvenprovee5;
    private javax.swing.JTable jtb_repxfamiliasxtienda;
    private javax.swing.JTextField jtf_buscarenjtable;
    private javax.swing.JTextField jtf_comff;
    private javax.swing.JTextField jtf_comff1;
    private javax.swing.JTextField jtf_comfi;
    private javax.swing.JTextField jtf_comfi1;
    private javax.swing.JTextField jtf_comidcla;
    private javax.swing.JTextField jtf_comidcla1;
    private javax.swing.JTextField jtf_comtie;
    private javax.swing.JTextField jtf_comtie1;
    private javax.swing.JTextField jtf_tiendavu;
    private javax.swing.JTextField jtf_total;
    private javax.swing.JTextField jtf_totalapartado;
    private javax.swing.JTextField jtf_totalventa;
    // End of variables declaration//GEN-END:variables
private sie_impresiones objimpresora;
}
